1 ;;; figl -*- mode: scheme; coding: utf-8 -*-
2 ;;; Copyright (C) 2013 Andy Wingo <wingo@pobox.com>
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.
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.
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/>.
18 ;;; Derived from upstream OpenGL documentation.
20 ;;; Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is licensed
21 ;;; under the SGI Free Software B License. For details, see
22 ;;; http://oss.sgi.com/projects/FreeB/ (http://oss.sgi.com/projects/FreeB/).
24 ;;; Copyright (C) 2003-2005 3Dlabs Inc. Ltd. This material may be
25 ;;; distributed subject to the terms and conditions set forth in the Open
26 ;;; Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
27 ;;; (http://opencontent.org/openpub/).
29 ;;; Copyright (C) 2005 Addison-Wesley. This material may be distributed
30 ;;; subject to the terms and conditions set forth in the Open Publication
31 ;;; License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
32 ;;; (http://opencontent.org/openpub/).
34 ;;; Copyright (C) 2006 Khronos Group. This material may be distributed
35 ;;; subject to the terms and conditions set forth in the Open Publication
36 ;;; License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
37 ;;; (http://opencontent.org/openpub/).
39 ;;; Automatically generated; you probably don't want to edit this. To
40 ;;; update, run "make update" in the top-level build tree.
65 glBlendEquationSeparate
93 glCompressedTexImage1D
94 glCompressedTexImage2D
95 glCompressedTexImage3D
96 glCompressedTexSubImage1D
97 glCompressedTexSubImage2D
98 glCompressedTexSubImage3D
100 glConvolutionFilter2D
101 glConvolutionParameterf
102 glConvolutionParameteri
105 glCopyConvolutionFilter1D
106 glCopyConvolutionFilter2D
136 glEnableVertexAttribArray
137 glDisableVertexAttribArray
166 glGetCompressedTexImage
167 glGetConvolutionFilter
206 glLoadTransposeMatrixf
229 glMultTransposeMatrixf
274 glSecondaryColorPointer
282 glStencilFuncSeparate
284 glStencilMaskSeparate
320 glVertexAttribPointer
343 (define-gl-procedures
344 ((glAccum (op GLenum) (value GLfloat) -> void))
345 "Operate on the accumulation buffer.
348 Specifies the accumulation buffer operation. Symbolic constants
349 `GL_ACCUM', `GL_LOAD', `GL_ADD', `GL_MULT', and `GL_RETURN' are
353 Specifies a floating-point value used in the accumulation buffer
354 operation. OP determines how VALUE is used.
356 The accumulation buffer is an extended-range color buffer. Images are
357 not rendered into it. Rather, images rendered into one of the color
358 buffers are added to the contents of the accumulation buffer after
359 rendering. Effects such as antialiasing (of points, lines, and
360 polygons), motion blur, and depth of field can be created by
361 accumulating images generated with different transformation matrices.
363 Each pixel in the accumulation buffer consists of red, green, blue, and
364 alpha values. The number of bits per component in the accumulation
365 buffer depends on the implementation. You can examine this number by
366 calling `glGetIntegerv' four times, with arguments `GL_ACCUM_RED_BITS',
367 `GL_ACCUM_GREEN_BITS', `GL_ACCUM_BLUE_BITS', and `GL_ACCUM_ALPHA_BITS'.
368 Regardless of the number of bits per component, the range of values
369 stored by each component is [-1,1] . The accumulation buffer pixels are
370 mapped one-to-one with frame buffer pixels.
372 `glAccum' operates on the accumulation buffer. The first argument, OP,
373 is a symbolic constant that selects an accumulation buffer operation.
374 The second argument, VALUE, is a floating-point value to be used in that
375 operation. Five operations are specified: `GL_ACCUM', `GL_LOAD',
376 `GL_ADD', `GL_MULT', and `GL_RETURN'.
378 All accumulation buffer operations are limited to the area of the
379 current scissor box and applied identically to the red, green, blue, and
380 alpha components of each pixel. If a `glAccum' operation results in a
381 value outside the range [-1,1] , the contents of an accumulation buffer
382 pixel component are undefined.
384 The operations are as follows:
387 Obtains R, G, B, and A values from the buffer currently selected
388 for reading (see `glReadBuffer'). Each component value is divided
389 by 2^N-1 , where N is the number of bits allocated to each color
390 component in the currently selected buffer. The result is a
391 floating-point value in the range [0,1] , which is multiplied by
392 VALUE and added to the corresponding pixel component in the
393 accumulation buffer, thereby updating the accumulation buffer.
396 Similar to `GL_ACCUM', except that the current value in the
397 accumulation buffer is not used in the calculation of the new
398 value. That is, the R, G, B, and A values from the currently
399 selected buffer are divided by 2^N-1 , multiplied by VALUE, and
400 then stored in the corresponding accumulation buffer cell,
401 overwriting the current value.
404 Adds VALUE to each R, G, B, and A in the accumulation buffer.
407 Multiplies each R, G, B, and A in the accumulation buffer by VALUE
408 and returns the scaled component to its corresponding accumulation
412 Transfers accumulation buffer values to the color buffer or buffers
413 currently selected for writing. Each R, G, B, and A component is
414 multiplied by VALUE, then multiplied by 2^N-1 , clamped to the
415 range [0,2^N-1] , and stored in the corresponding display buffer
416 cell. The only fragment operations that are applied to this
417 transfer are pixel ownership, scissor, dithering, and color
420 To clear the accumulation buffer, call `glClearAccum' with R, G, B, and
421 A values to set it to, then call `glClear' with the accumulation buffer
424 `GL_INVALID_ENUM' is generated if OP is not an accepted value.
426 `GL_INVALID_OPERATION' is generated if there is no accumulation buffer.
428 `GL_INVALID_OPERATION' is generated if `glAccum' is executed between the
429 execution of `glBegin' and the corresponding execution of `glEnd'.")
431 (define-gl-procedures
432 ((glActiveTexture (texture GLenum) -> void))
433 "Select active texture unit.
436 Specifies which texture unit to make active. The number of texture
437 units is implementation dependent, but must be at least two.
438 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
439 the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
440 (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1). The initial value is
443 `glActiveTexture' selects which texture unit subsequent texture state
444 calls will affect. The number of texture units an implementation
445 supports is implementation dependent, but must be at least 2.
447 Vertex arrays are client-side GL resources, which are selected by the
448 `glClientActiveTexture' routine.
450 `GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
451 where i ranges from 0 to the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
452 (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1).")
454 (define-gl-procedures
460 "Specify the alpha test function.
463 Specifies the alpha comparison function. Symbolic constants
464 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
465 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
466 initial value is `GL_ALWAYS'.
469 Specifies the reference value that incoming alpha values are
470 compared to. This value is clamped to the range [0,1] , where 0
471 represents the lowest possible alpha value and 1 the highest
472 possible value. The initial reference value is 0.
474 The alpha test discards fragments depending on the outcome of a
475 comparison between an incoming fragment's alpha value and a constant
476 reference value. `glAlphaFunc' specifies the reference value and the
477 comparison function. The comparison is performed only if alpha testing
478 is enabled. By default, it is not enabled. (See `glEnable' and
479 `glDisable' of `GL_ALPHA_TEST'.)
481 FUNC and REF specify the conditions under which the pixel is drawn. The
482 incoming alpha value is compared to REF using the function specified by
483 FUNC. If the value passes the comparison, the incoming fragment is drawn
484 if it also passes subsequent stencil and depth buffer tests. If the
485 value fails the comparison, no change is made to the frame buffer at
486 that pixel location. The comparison functions are as follows:
492 Passes if the incoming alpha value is less than the reference
496 Passes if the incoming alpha value is equal to the reference value.
499 Passes if the incoming alpha value is less than or equal to the
503 Passes if the incoming alpha value is greater than the reference
507 Passes if the incoming alpha value is not equal to the reference
511 Passes if the incoming alpha value is greater than or equal to the
515 Always passes (initial value).
517 `glAlphaFunc' operates on all pixel write operations, including those
518 resulting from the scan conversion of points, lines, polygons, and
519 bitmaps, and from pixel draw and copy operations. `glAlphaFunc' does not
520 affect screen clear operations.
522 `GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
524 `GL_INVALID_OPERATION' is generated if `glAlphaFunc' is executed between
525 the execution of `glBegin' and the corresponding execution of `glEnd'.")
527 (define-gl-procedures
528 ((glAreTexturesResident
530 (textures const-GLuint-*)
531 (residences GLboolean-*)
534 "Determine if textures are loaded in texture memory.
537 Specifies the number of textures to be queried.
540 Specifies an array containing the names of the textures to be
544 Specifies an array in which the texture residence status is
545 returned. The residence status of a texture named by an element of
546 TEXTURES is returned in the corresponding element of RESIDENCES.
548 GL establishes a ``working set'' of textures that are resident in
549 texture memory. These textures can be bound to a texture target much
550 more efficiently than textures that are not resident.
552 `glAreTexturesResident' queries the texture residence status of the N
553 textures named by the elements of TEXTURES. If all the named textures
554 are resident, `glAreTexturesResident' returns `GL_TRUE', and the
555 contents of RESIDENCES are undisturbed. If not all the named textures
556 are resident, `glAreTexturesResident' returns `GL_FALSE', and detailed
557 status is returned in the N elements of RESIDENCES. If an element of
558 RESIDENCES is `GL_TRUE', then the texture named by the corresponding
559 element of TEXTURES is resident.
561 The residence status of a single bound texture may also be queried by
562 calling `glGetTexParameter' with the TARGET argument set to the target
563 to which the texture is bound, and the PNAME argument set to
564 `GL_TEXTURE_RESIDENT'. This is the only way that the residence status of
565 a default texture can be queried.
567 `GL_INVALID_VALUE' is generated if N is negative.
569 `GL_INVALID_VALUE' is generated if any element in TEXTURES is 0 or does
570 not name a texture. In that case, the function returns `GL_FALSE' and
571 the contents of RESIDENCES is indeterminate.
573 `GL_INVALID_OPERATION' is generated if `glAreTexturesResident' is
574 executed between the execution of `glBegin' and the corresponding
575 execution of `glEnd'.")
577 (define-gl-procedures
578 ((glArrayElement (i GLint) -> void))
579 "Render a vertex using the specified vertex array element.
582 Specifies an index into the enabled vertex data arrays.
584 `glArrayElement' commands are used within `glBegin'/`glEnd' pairs to
585 specify vertex and attribute data for point, line, and polygon
586 primitives. If `GL_VERTEX_ARRAY' is enabled when `glArrayElement' is
587 called, a single vertex is drawn, using vertex and attribute data taken
588 from location I of the enabled arrays. If `GL_VERTEX_ARRAY' is not
589 enabled, no drawing occurs but the attributes corresponding to the
590 enabled arrays are modified.
592 Use `glArrayElement' to construct primitives by indexing vertex data,
593 rather than by streaming through arrays of data in first-to-last order.
594 Because each call specifies only a single vertex, it is possible to
595 explicitly specify per-primitive attributes such as a single normal for
598 Changes made to array data between the execution of `glBegin' and the
599 corresponding execution of `glEnd' may affect calls to `glArrayElement'
600 that are made within the same `glBegin'/`glEnd' period in nonsequential
601 ways. That is, a call to `glArrayElement' that precedes a change to
602 array data may access the changed data, and a call that follows a change
603 to array data may access original data.
605 `GL_INVALID_VALUE' may be generated if I is negative.
607 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
608 bound to an enabled array and the buffer object's data store is
611 (define-gl-procedures
617 "Attaches a shader object to a program object.
620 Specifies the program object to which a shader object will be
624 Specifies the shader object that is to be attached.
626 In order to create an executable, there must be a way to specify the
627 list of things that will be linked together. Program objects provide
628 this mechanism. Shaders that are to be linked together in a program
629 object must first be attached to that program object. `glAttachShader'
630 attaches the shader object specified by SHADER to the program object
631 specified by PROGRAM. This indicates that SHADER will be included in
632 link operations that will be performed on PROGRAM.
634 All operations that can be performed on a shader object are valid
635 whether or not the shader object is attached to a program object. It is
636 permissible to attach a shader object to a program object before source
637 code has been loaded into the shader object or before the shader object
638 has been compiled. It is permissible to attach multiple shader objects
639 of the same type because each may contain a portion of the complete
640 shader. It is also permissible to attach a shader object to more than
641 one program object. If a shader object is deleted while it is attached
642 to a program object, it will be flagged for deletion, and deletion will
643 not occur until `glDetachShader' is called to detach it from all program
644 objects to which it is attached.
646 `GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is not a
647 value generated by OpenGL.
649 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
651 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
653 `GL_INVALID_OPERATION' is generated if SHADER is already attached to
656 `GL_INVALID_OPERATION' is generated if `glAttachShader' is executed
657 between the execution of `glBegin' and the corresponding execution of
660 (define-gl-procedures
666 (glEndQuery (target GLenum) -> void))
667 "Delimit the boundaries of a query object.
670 Specifies the target type of query object established between
671 `glBeginQuery' and the subsequent `glEndQuery'. The symbolic
672 constant must be `GL_SAMPLES_PASSED'.
675 Specifies the name of a query object.
677 `glBeginQuery' and `glEndQuery' delimit the boundaries of a query
678 object. If a query object with name ID does not yet exist it is created.
680 When `glBeginQuery' is executed, the query object's samples-passed
681 counter is reset to 0. Subsequent rendering will increment the counter
682 once for every sample that passes the depth test. When `glEndQuery' is
683 executed, the samples-passed counter is assigned to the query object's
684 result value. This value can be queried by calling `glGetQueryObject'
685 with PNAME`GL_QUERY_RESULT'.
687 Querying the `GL_QUERY_RESULT' implicitly flushes the GL pipeline until
688 the rendering delimited by the query object has completed and the result
689 is available. `GL_QUERY_RESULT_AVAILABLE' can be queried to determine if
690 the result is immediately available or if the rendering is not yet
693 `GL_INVALID_ENUM' is generated if TARGET is not `GL_SAMPLES_PASSED'.
695 `GL_INVALID_OPERATION' is generated if `glBeginQuery' is executed while
696 a query object of the same TARGET is already active.
698 `GL_INVALID_OPERATION' is generated if `glEndQuery' is executed when a
699 query object of the same TARGET is not active.
701 `GL_INVALID_OPERATION' is generated if ID is 0.
703 `GL_INVALID_OPERATION' is generated if ID is the name of an already
706 `GL_INVALID_OPERATION' is generated if `glBeginQuery' or `glEndQuery' is
707 executed between the execution of `glBegin' and the corresponding
708 execution of `glEnd'.")
710 (define-gl-procedures
711 ((glBegin (mode GLenum) -> void) (glEnd -> void))
712 "Delimit the vertices of a primitive or a group of like primitives.
715 Specifies the primitive or primitives that will be created from
716 vertices presented between `glBegin' and the subsequent `glEnd'.
717 Ten symbolic constants are accepted: `GL_POINTS', `GL_LINES',
718 `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_TRIANGLES',
719 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_QUADS',
720 `GL_QUAD_STRIP', and `GL_POLYGON'.
722 `glBegin' and `glEnd' delimit the vertices that define a primitive or a
723 group of like primitives. `glBegin' accepts a single argument that
724 specifies in which of ten ways the vertices are interpreted. Taking N as
725 an integer count starting at one, and N as the total number of vertices
726 specified, the interpretations are as follows:
729 Treats each vertex as a single point. Vertex N defines point N . N
733 Treats each pair of vertices as an independent line segment.
734 Vertices 2\u2062N-1 and 2\u2062N define line N . N/2 lines are drawn.
737 Draws a connected group of line segments from the first vertex to
738 the last. Vertices N and N+1 define line N . N-1 lines are drawn.
741 Draws a connected group of line segments from the first vertex to
742 the last, then back to the first. Vertices N and N+1 define line N
743 . The last line, however, is defined by vertices N and 1 . N lines
747 Treats each triplet of vertices as an independent triangle.
748 Vertices 3\u2062N-2 , 3\u2062N-1 , and 3\u2062N define triangle N . N/3 triangles
752 Draws a connected group of triangles. One triangle is defined for
753 each vertex presented after the first two vertices. For odd N ,
754 vertices N , N+1 , and N+2 define triangle N . For even N ,
755 vertices N+1 , N , and N+2 define triangle N . N-2 triangles are
759 Draws a connected group of triangles. One triangle is defined for
760 each vertex presented after the first two vertices. Vertices 1 ,
761 N+1 , and N+2 define triangle N . N-2 triangles are drawn.
764 Treats each group of four vertices as an independent quadrilateral.
765 Vertices 4\u2062N-3 , 4\u2062N-2 , 4\u2062N-1 , and 4\u2062N define quadrilateral N .
766 N/4 quadrilaterals are drawn.
769 Draws a connected group of quadrilaterals. One quadrilateral is
770 defined for each pair of vertices presented after the first pair.
771 Vertices 2\u2062N-1 , 2\u2062N , 2\u2062N+2 , and 2\u2062N+1 define quadrilateral N .
772 N/2-1 quadrilaterals are drawn. Note that the order in which
773 vertices are used to construct a quadrilateral from strip data is
774 different from that used with independent data.
777 Draws a single, convex polygon. Vertices 1 through N define this
780 Only a subset of GL commands can be used between `glBegin' and `glEnd'.
781 The commands are `glVertex', `glColor', `glSecondaryColor', `glIndex',
782 `glNormal', `glFogCoord', `glTexCoord', `glMultiTexCoord',
783 `glVertexAttrib', `glEvalCoord', `glEvalPoint', `glArrayElement',
784 `glMaterial', and `glEdgeFlag'. Also, it is acceptable to use
785 `glCallList' or `glCallLists' to execute display lists that include only
786 the preceding commands. If any other GL command is executed between
787 `glBegin' and `glEnd', the error flag is set and the command is ignored.
789 Regardless of the value chosen for MODE, there is no limit to the number
790 of vertices that can be defined between `glBegin' and `glEnd'. Lines,
791 triangles, quadrilaterals, and polygons that are incompletely specified
792 are not drawn. Incomplete specification results when either too few
793 vertices are provided to specify even a single primitive or when an
794 incorrect multiple of vertices is specified. The incomplete primitive is
795 ignored; the rest are drawn.
797 The minimum specification of vertices for each primitive is as follows:
798 1 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral,
799 and 3 for a polygon. Modes that require a certain multiple of vertices
800 are `GL_LINES' (2), `GL_TRIANGLES' (3), `GL_QUADS' (4), and
803 `GL_INVALID_ENUM' is generated if MODE is set to an unaccepted value.
805 `GL_INVALID_OPERATION' is generated if `glBegin' is executed between a
806 `glBegin' and the corresponding execution of `glEnd'.
808 `GL_INVALID_OPERATION' is generated if `glEnd' is executed without being
809 preceded by a `glBegin'.
811 `GL_INVALID_OPERATION' is generated if a command other than `glVertex',
812 `glColor', `glSecondaryColor', `glIndex', `glNormal', `glFogCoord',
813 `glTexCoord', `glMultiTexCoord', `glVertexAttrib', `glEvalCoord',
814 `glEvalPoint', `glArrayElement', `glMaterial', `glEdgeFlag',
815 `glCallList', or `glCallLists' is executed between the execution of
816 `glBegin' and the corresponding execution `glEnd'.
818 Execution of `glEnableClientState', `glDisableClientState',
819 `glEdgeFlagPointer', `glFogCoordPointer', `glTexCoordPointer',
820 `glColorPointer', `glSecondaryColorPointer', `glIndexPointer',
821 `glNormalPointer', `glVertexPointer', `glVertexAttribPointer',
822 `glInterleavedArrays', or `glPixelStore' is not allowed after a call to
823 `glBegin' and before the corresponding call to `glEnd', but an error may
824 or may not be generated.")
826 (define-gl-procedures
827 ((glBindAttribLocation
830 (name const-GLchar-*)
833 "Associates a generic vertex attribute index with a named attribute
837 Specifies the handle of the program object in which the association
841 Specifies the index of the generic vertex attribute to be bound.
844 Specifies a null terminated string containing the name of the
845 vertex shader attribute variable to which INDEX is to be bound.
847 `glBindAttribLocation' is used to associate a user-defined attribute
848 variable in the program object specified by PROGRAM with a generic
849 vertex attribute index. The name of the user-defined attribute variable
850 is passed as a null terminated string in NAME. The generic vertex
851 attribute index to be bound to this variable is specified by INDEX. When
852 PROGRAM is made part of current state, values provided via the generic
853 vertex attribute INDEX will modify the value of the user-defined
854 attribute variable specified by NAME.
856 If NAME refers to a matrix attribute variable, INDEX refers to the first
857 column of the matrix. Other matrix columns are then automatically bound
858 to locations INDEX+1 for a matrix of type mat2; INDEX+1 and INDEX+2 for
859 a matrix of type mat3; and INDEX+1, INDEX+2, and INDEX+3 for a matrix of
862 This command makes it possible for vertex shaders to use descriptive
863 names for attribute variables rather than generic variables that are
864 numbered from 0 to `GL_MAX_VERTEX_ATTRIBS' -1. The values sent to each
865 generic attribute index are part of current state, just like standard
866 vertex attributes such as color, normal, and vertex position. If a
867 different program object is made current by calling `glUseProgram', the
868 generic vertex attributes are tracked in such a way that the same values
869 will be observed by attributes in the new program object that are also
872 Attribute variable name-to-generic attribute index bindings for a
873 program object can be explicitly assigned at any time by calling
874 `glBindAttribLocation'. Attribute bindings do not go into effect until
875 `glLinkProgram' is called. After a program object has been linked
876 successfully, the index values for generic attributes remain fixed (and
877 their values can be queried) until the next link command occurs.
879 Applications are not allowed to bind any of the standard OpenGL vertex
880 attributes using this command, as they are bound automatically when
881 needed. Any attribute binding that occurs after the program object has
882 been linked will not take effect until the next time the program object
885 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
886 `GL_MAX_VERTEX_ATTRIBS'.
888 `GL_INVALID_OPERATION' is generated if NAME starts with the reserved
891 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
894 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
896 `GL_INVALID_OPERATION' is generated if `glBindAttribLocation' is
897 executed between the execution of `glBegin' and the corresponding
898 execution of `glEnd'.")
900 (define-gl-procedures
906 "Bind a named buffer object.
909 Specifies the target to which the buffer object is bound. The
910 symbolic constant must be `GL_ARRAY_BUFFER',
911 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
912 `GL_PIXEL_UNPACK_BUFFER'.
915 Specifies the name of a buffer object.
917 `glBindBuffer' lets you create or use a named buffer object. Calling
918 `glBindBuffer' with TARGET set to `GL_ARRAY_BUFFER',
919 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER' or
920 `GL_PIXEL_UNPACK_BUFFER' and BUFFER set to the name of the new buffer
921 object binds the buffer object name to the target. When a buffer object
922 is bound to a target, the previous binding for that target is
923 automatically broken.
925 Buffer object names are unsigned integers. The value zero is reserved,
926 but there is no default buffer object for each buffer object target.
927 Instead, BUFFER set to zero effectively unbinds any buffer object
928 previously bound, and restores client memory usage for that buffer
929 object target. Buffer object names and the corresponding buffer object
930 contents are local to the shared display-list space (see
931 `glXCreateContext') of the current GL rendering context; two rendering
932 contexts share buffer object names only if they also share display
935 You may use `glGenBuffers' to generate a set of new buffer object names.
937 The state of a buffer object immediately after it is first bound is an
938 unmapped zero-sized memory buffer with `GL_READ_WRITE' access and
939 `GL_STATIC_DRAW' usage.
941 While a non-zero buffer object name is bound, GL operations on the
942 target to which it is bound affect the bound buffer object, and queries
943 of the target to which it is bound return state from the bound buffer
944 object. While buffer object name zero is bound, as in the initial state,
945 attempts to modify or query state on the target to which it is bound
946 generates an `GL_INVALID_OPERATION' error.
948 When vertex array pointer state is changed, for example by a call to
949 `glNormalPointer', the current buffer object binding
950 (`GL_ARRAY_BUFFER_BINDING') is copied into the corresponding client
951 state for the vertex array type being changed, for example
952 `GL_NORMAL_ARRAY_BUFFER_BINDING'. While a non-zero buffer object is
953 bound to the `GL_ARRAY_BUFFER' target, the vertex array pointer
954 parameter that is traditionally interpreted as a pointer to client-side
955 memory is instead interpreted as an offset within the buffer object
956 measured in basic machine units.
958 While a non-zero buffer object is bound to the `GL_ELEMENT_ARRAY_BUFFER'
959 target, the indices parameter of `glDrawElements',
960 `glDrawRangeElements', or `glMultiDrawElements' that is traditionally
961 interpreted as a pointer to client-side memory is instead interpreted as
962 an offset within the buffer object measured in basic machine units.
964 While a non-zero buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
965 target, the following commands are affected: `glGetCompressedTexImage',
966 `glGetConvolutionFilter', `glGetHistogram', `glGetMinmax',
967 `glGetPixelMap', `glGetPolygonStipple', `glGetSeparableFilter',
968 `glGetTexImage', and `glReadPixels'. The pointer parameter that is
969 traditionally interpreted as a pointer to client-side memory where the
970 pixels are to be packed is instead interpreted as an offset within the
971 buffer object measured in basic machine units.
973 While a non-zero buffer object is bound to the `GL_PIXEL_UNPACK_BUFFER'
974 target, the following commands are affected: `glBitmap',
975 `glColorSubTable', `glColorTable', `glCompressedTexImage1D',
976 `glCompressedTexImage2D', `glCompressedTexImage3D',
977 `glCompressedTexSubImage1D', `glCompressedTexSubImage2D',
978 `glCompressedTexSubImage3D', `glConvolutionFilter1D',
979 `glConvolutionFilter2D', `glDrawPixels', `glPixelMap',
980 `glPolygonStipple', `glSeparableFilter2D', `glTexImage1D',
981 `glTexImage2D', `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
982 and `glTexSubImage3D'. The pointer parameter that is traditionally
983 interpreted as a pointer to client-side memory from which the pixels are
984 to be unpacked is instead interpreted as an offset within the buffer
985 object measured in basic machine units.
987 A buffer object binding created with `glBindBuffer' remains active until
988 a different buffer object name is bound to the same target, or until the
989 bound buffer object is deleted with `glDeleteBuffers'.
991 Once created, a named buffer object may be re-bound to any target as
992 often as needed. However, the GL implementation may make choices about
993 how to optimize the storage of a buffer object based on its initial
996 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
999 `GL_INVALID_OPERATION' is generated if `glBindBuffer' is executed
1000 between the execution of `glBegin' and the corresponding execution of
1003 (define-gl-procedures
1009 "Bind a named texture to a texturing target.
1012 Specifies the target to which the texture is bound. Must be either
1013 `GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D', or
1014 `GL_TEXTURE_CUBE_MAP'.
1017 Specifies the name of a texture.
1019 `glBindTexture' lets you create or use a named texture. Calling
1020 `glBindTexture' with TARGET set to `GL_TEXTURE_1D', `GL_TEXTURE_2D',
1021 `GL_TEXTURE_3D' or `GL_TEXTURE_CUBE_MAP' and TEXTURE set to the name of
1022 the new texture binds the texture name to the target. When a texture is
1023 bound to a target, the previous binding for that target is automatically
1026 Texture names are unsigned integers. The value zero is reserved to
1027 represent the default texture for each texture target. Texture names and
1028 the corresponding texture contents are local to the shared display-list
1029 space (see `glXCreateContext') of the current GL rendering context; two
1030 rendering contexts share texture names only if they also share display
1033 You may use `glGenTextures' to generate a set of new texture names.
1035 When a texture is first bound, it assumes the specified target: A
1036 texture first bound to `GL_TEXTURE_1D' becomes one-dimensional texture,
1037 a texture first bound to `GL_TEXTURE_2D' becomes two-dimensional
1038 texture, a texture first bound to `GL_TEXTURE_3D' becomes
1039 three-dimensional texture, and a texture first bound to
1040 `GL_TEXTURE_CUBE_MAP' becomes a cube-mapped texture. The state of a
1041 one-dimensional texture immediately after it is first bound is
1042 equivalent to the state of the default `GL_TEXTURE_1D' at GL
1043 initialization, and similarly for two- and three-dimensional textures
1044 and cube-mapped textures.
1046 While a texture is bound, GL operations on the target to which it is
1047 bound affect the bound texture, and queries of the target to which it is
1048 bound return state from the bound texture. If texture mapping is active
1049 on the target to which a texture is bound, the bound texture is used. In
1050 effect, the texture targets become aliases for the textures currently
1051 bound to them, and the texture name zero refers to the default textures
1052 that were bound to them at initialization.
1054 A texture binding created with `glBindTexture' remains active until a
1055 different texture is bound to the same target, or until the bound
1056 texture is deleted with `glDeleteTextures'.
1058 Once created, a named texture may be re-bound to its same original
1059 target as often as needed. It is usually much faster to use
1060 `glBindTexture' to bind an existing named texture to one of the texture
1061 targets than it is to reload the texture image using `glTexImage1D',
1062 `glTexImage2D', or `glTexImage3D'. For additional control over
1063 performance, use `glPrioritizeTextures'.
1065 `glBindTexture' is included in display lists.
1067 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
1070 `GL_INVALID_OPERATION' is generated if TEXTURE was previously created
1071 with a target that doesn't match that of TARGET.
1073 `GL_INVALID_OPERATION' is generated if `glBindTexture' is executed
1074 between the execution of `glBegin' and the corresponding execution of
1077 (define-gl-procedures
1085 (bitmap const-GLubyte-*)
1093 Specify the pixel width and height of the bitmap image.
1098 Specify the location of the origin in the bitmap image. The origin
1099 is measured from the lower left corner of the bitmap, with right
1100 and up being the positive axes.
1105 Specify the X and Y offsets to be added to the current raster
1106 position after the bitmap is drawn.
1109 Specifies the address of the bitmap image.
1111 A bitmap is a binary image. When drawn, the bitmap is positioned
1112 relative to the current raster position, and frame buffer pixels
1113 corresponding to 1's in the bitmap are written using the current raster
1114 color or index. Frame buffer pixels corresponding to 0's in the bitmap
1117 `glBitmap' takes seven arguments. The first pair specifies the width and
1118 height of the bitmap image. The second pair specifies the location of
1119 the bitmap origin relative to the lower left corner of the bitmap image.
1120 The third pair of arguments specifies X and Y offsets to be added to the
1121 current raster position after the bitmap has been drawn. The final
1122 argument is a pointer to the bitmap image itself.
1124 If a non-zero named buffer object is bound to the
1125 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a bitmap
1126 image is specified, BITMAP is treated as a byte offset into the buffer
1127 object's data store.
1129 The bitmap image is interpreted like image data for the `glDrawPixels'
1130 command, with WIDTH and HEIGHT corresponding to the width and height
1131 arguments of that command, and with TYPE set to `GL_BITMAP' and FORMAT
1132 set to `GL_COLOR_INDEX'. Modes specified using `glPixelStore' affect the
1133 interpretation of bitmap image data; modes specified using
1134 `glPixelTransfer' do not.
1136 If the current raster position is invalid, `glBitmap' is ignored.
1137 Otherwise, the lower left corner of the bitmap image is positioned at
1138 the window coordinates
1144 where (X_R,Y_R) is the raster position and (X_O,Y_O) is the bitmap
1145 origin. Fragments are then generated for each pixel corresponding to a 1
1146 (one) in the bitmap image. These fragments are generated using the
1147 current raster Z coordinate, color or color index, and current raster
1148 texture coordinates. They are then treated just as if they had been
1149 generated by a point, line, or polygon, including texture mapping,
1150 fogging, and all per-fragment operations such as alpha and depth
1153 After the bitmap has been drawn, the X and Y coordinates of the current
1154 raster position are offset by XMOVE and YMOVE. No change is made to the
1155 Z coordinate of the current raster position, or to the current raster
1156 color, texture coordinates, or index.
1158 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is negative.
1160 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1161 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
1162 data store is currently mapped.
1164 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1165 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
1166 unpacked from the buffer object such that the memory reads required
1167 would exceed the data store size.
1169 `GL_INVALID_OPERATION' is generated if `glBitmap' is executed between
1170 the execution of `glBegin' and the corresponding execution of `glEnd'.")
1172 (define-gl-procedures
1180 "Set the blend color.
1189 specify the components of `GL_BLEND_COLOR'
1191 The `GL_BLEND_COLOR' may be used to calculate the source and destination
1192 blending factors. The color components are clamped to the range [0,1]
1193 before being stored. See `glBlendFunc' for a complete description of the
1194 blending operations. Initially the `GL_BLEND_COLOR' is set to (0, 0, 0,
1197 `GL_INVALID_OPERATION' is generated if `glBlendColor' is executed
1198 between the execution of `glBegin' and the corresponding execution of
1201 (define-gl-procedures
1202 ((glBlendEquationSeparate
1207 "Set the RGB blend equation and the alpha blend equation separately.
1210 specifies the RGB blend equation, how the red, green, and blue
1211 components of the source and destination colors are combined. It
1212 must be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
1213 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN', `GL_MAX'.
1216 specifies the alpha blend equation, how the alpha component of the
1217 source and destination colors are combined. It must be
1218 `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1221 The blend equations determines how a new pixel (the ''source'' color) is
1222 combined with a pixel already in the framebuffer (the ''destination''
1223 color). This function specifies one blend equation for the RGB-color
1224 components and one blend equation for the alpha component.
1226 The blend equations use the source and destination blend factors
1227 specified by either `glBlendFunc' or `glBlendFuncSeparate'. See
1228 `glBlendFunc' or `glBlendFuncSeparate' for a description of the various
1231 In the equations that follow, source and destination color components
1232 are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1233 The result color is referred to as (R_R,G_RB_RA_R) . The source and
1234 destination blend factors are denoted (S_R,S_GS_BS_A) and
1235 (D_R,D_GD_BD_A) , respectively. For these equations all color components
1236 are understood to have values in the range [0,1] .
1239 *RGB Components*, *Alpha Component*
1242 RR=R_S\u2062S_R+R_D\u2062D_R GR=G_S\u2062S_G+G_D\u2062D_G BR=B_S\u2062S_B+B_D\u2062D_B ,
1243 AR=A_S\u2062S_A+A_D\u2062D_A
1246 RR=R_S\u2062S_R-R_D\u2062D_R GR=G_S\u2062S_G-G_D\u2062D_G BR=B_S\u2062S_B-B_D\u2062D_B ,
1247 AR=A_S\u2062S_A-A_D\u2062D_A
1249 `GL_FUNC_REVERSE_SUBTRACT'
1250 RR=R_D\u2062D_R-R_S\u2062S_R GR=G_D\u2062D_G-G_S\u2062S_G BR=B_D\u2062D_B-B_S\u2062S_B ,
1251 AR=A_D\u2062D_A-A_S\u2062S_A
1254 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1255 AR=MIN\u2061(A_S,A_D)
1258 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1259 AR=MAX\u2061(A_S,A_D)
1261 The results of these equations are clamped to the range [0,1] .
1263 The `GL_MIN' and `GL_MAX' equations are useful for applications that
1264 analyze image data (image thresholding against a constant color, for
1265 example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1266 transparency, among other things.
1268 Initially, both the RGB blend equation and the alpha blend equation are
1269 set to `GL_FUNC_ADD'.
1273 `GL_INVALID_ENUM' is generated if either MODERGB or MODEALPHA is not one
1274 of `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1275 `GL_MAX', or `GL_MIN'.
1277 `GL_INVALID_OPERATION' is generated if `glBlendEquationSeparate' is
1278 executed between the execution of `glBegin' and the corresponding
1279 execution of `glEnd'.")
1281 (define-gl-procedures
1282 ((glBlendEquation (mode GLenum) -> void))
1283 "Specify the equation used for both the RGB blend equation and the Alpha
1287 specifies how source and destination colors are combined. It must
1288 be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1291 The blend equations determine how a new pixel (the ''source'' color) is
1292 combined with a pixel already in the framebuffer (the ''destination''
1293 color). This function sets both the RGB blend equation and the alpha
1294 blend equation to a single equation.
1296 These equations use the source and destination blend factors specified
1297 by either `glBlendFunc' or `glBlendFuncSeparate'. See `glBlendFunc' or
1298 `glBlendFuncSeparate' for a description of the various blend factors.
1300 In the equations that follow, source and destination color components
1301 are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1302 The result color is referred to as (R_R,G_RB_RA_R) . The source and
1303 destination blend factors are denoted (S_R,S_GS_BS_A) and
1304 (D_R,D_GD_BD_A) , respectively. For these equations all color components
1305 are understood to have values in the range [0,1] .
1308 *RGB Components*, *Alpha Component*
1311 RR=R_S\u2062S_R+R_D\u2062D_R GR=G_S\u2062S_G+G_D\u2062D_G BR=B_S\u2062S_B+B_D\u2062D_B ,
1312 AR=A_S\u2062S_A+A_D\u2062D_A
1315 RR=R_S\u2062S_R-R_D\u2062D_R GR=G_S\u2062S_G-G_D\u2062D_G BR=B_S\u2062S_B-B_D\u2062D_B ,
1316 AR=A_S\u2062S_A-A_D\u2062D_A
1318 `GL_FUNC_REVERSE_SUBTRACT'
1319 RR=R_D\u2062D_R-R_S\u2062S_R GR=G_D\u2062D_G-G_S\u2062S_G BR=B_D\u2062D_B-B_S\u2062S_B ,
1320 AR=A_D\u2062D_A-A_S\u2062S_A
1323 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1324 AR=MIN\u2061(A_S,A_D)
1327 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1328 AR=MAX\u2061(A_S,A_D)
1330 The results of these equations are clamped to the range [0,1] .
1332 The `GL_MIN' and `GL_MAX' equations are useful for applications that
1333 analyze image data (image thresholding against a constant color, for
1334 example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1335 transparency, among other things.
1337 Initially, both the RGB blend equation and the alpha blend equation are
1338 set to `GL_FUNC_ADD'.
1342 `GL_INVALID_ENUM' is generated if MODE is not one of `GL_FUNC_ADD',
1343 `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', `GL_MAX', or `GL_MIN'.
1345 `GL_INVALID_OPERATION' is generated if `glBlendEquation' is executed
1346 between the execution of `glBegin' and the corresponding execution of
1349 (define-gl-procedures
1350 ((glBlendFuncSeparate
1357 "Specify pixel arithmetic for RGB and alpha components separately.
1360 Specifies how the red, green, and blue blending factors are
1361 computed. The following symbolic constants are accepted: `GL_ZERO',
1362 `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR',
1363 `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA',
1364 `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1365 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1366 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1367 initial value is `GL_ONE'.
1370 Specifies how the red, green, and blue destination blending factors
1371 are computed. The following symbolic constants are accepted:
1372 `GL_ZERO', `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR',
1373 `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA',
1374 `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA'.
1375 `GL_CONSTANT_COLOR', `GL_ONE_MINUS_CONSTANT_COLOR',
1376 `GL_CONSTANT_ALPHA', and `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial
1380 Specified how the alpha source blending factor is computed. The
1381 same symbolic constants are accepted as for SRCRGB. The initial
1385 Specified how the alpha destination blending factor is computed.
1386 The same symbolic constants are accepted as for DSTRGB. The initial
1389 In RGBA mode, pixels can be drawn using a function that blends the
1390 incoming (source) RGBA values with the RGBA values that are already in
1391 the frame buffer (the destination values). Blending is initially
1392 disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1393 enable and disable blending.
1395 `glBlendFuncSeparate' defines the operation of blending when it is
1396 enabled. SRCRGB specifies which method is used to scale the source
1397 RGB-color components. DSTRGB specifies which method is used to scale the
1398 destination RGB-color components. Likewise, SRCALPHA specifies which
1399 method is used to scale the source alpha color component, and DSTALPHA
1400 specifies which method is used to scale the destination alpha component.
1401 The possible methods are described in the following table. Each method
1402 defines four scale factors, one each for red, green, blue, and alpha.
1404 In the table and in subsequent equations, source and destination color
1405 components are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The
1406 color specified by `glBlendColor' is referred to as (R_C,G_CB_CA_C) .
1407 They are understood to have integer values between 0 and (K_R,K_GK_BK_A)
1412 and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1415 Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1416 and (D_R,D_GD_BD_A) . All scale factors have range [0,1] .
1421 *RGB Factor*, *Alpha Factor*
1430 (R_S/K_R,G_S/K_GB_S/K_B) , A_S/K_A
1432 `GL_ONE_MINUS_SRC_COLOR'
1433 (1,111)-(R_S/K_R,G_S/K_GB_S/K_B) , 1-A_S/K_A
1436 (R_D/K_R,G_D/K_GB_D/K_B) , A_D/K_A
1438 `GL_ONE_MINUS_DST_COLOR'
1439 (1,11)-(R_D/K_R,G_D/K_GB_D/K_B) , 1-A_D/K_A
1442 (A_S/K_A,A_S/K_AA_S/K_A) , A_S/K_A
1444 `GL_ONE_MINUS_SRC_ALPHA'
1445 (1,11)-(A_S/K_A,A_S/K_AA_S/K_A) , 1-A_S/K_A
1448 (A_D/K_A,A_D/K_AA_D/K_A) , A_D/K_A
1450 `GL_ONE_MINUS_DST_ALPHA'
1451 (1,11)-(A_D/K_A,A_D/K_AA_D/K_A) , 1-A_D/K_A
1456 `GL_ONE_MINUS_CONSTANT_COLOR'
1457 (1,11)-(R_C,G_CB_C) , 1-A_C
1462 `GL_ONE_MINUS_CONSTANT_ALPHA'
1463 (1,11)-(A_C,A_CA_C) , 1-A_C
1465 `GL_SRC_ALPHA_SATURATE'
1470 I=MIN\u2061(A_S,1-A_D,)
1472 To determine the blended RGBA values of a pixel when drawing in RGBA
1473 mode, the system uses the following equations:
1475 R_D=MIN\u2061(K_R,R_S\u2062S_R+R_D\u2062D_R) G_D=MIN\u2061(K_G,G_S\u2062S_G+G_D\u2062D_G)
1476 B_D=MIN\u2061(K_B,B_S\u2062S_B+B_D\u2062D_B) A_D=MIN\u2061(K_A,A_S\u2062S_A+A_D\u2062D_A)
1478 Despite the apparent precision of the above equations, blending
1479 arithmetic is not exactly specified, because blending operates with
1480 imprecise integer color values. However, a blend factor that should be
1481 equal to 1 is guaranteed not to modify its multiplicand, and a blend
1482 factor equal to 0 reduces its multiplicand to 0. For example, when
1483 SRCRGB is `GL_SRC_ALPHA', DSTRGB is `GL_ONE_MINUS_SRC_ALPHA', and A_S is
1484 equal to K_A , the equations reduce to simple replacement:
1486 R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1490 `GL_INVALID_ENUM' is generated if either SRCRGB or DSTRGB is not an
1493 `GL_INVALID_OPERATION' is generated if `glBlendFuncSeparate' is executed
1494 between the execution of `glBegin' and the corresponding execution of
1497 (define-gl-procedures
1503 "Specify pixel arithmetic.
1506 Specifies how the red, green, blue, and alpha source blending
1507 factors are computed. The following symbolic constants are
1508 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1509 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1510 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1511 `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1512 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1513 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1514 initial value is `GL_ONE'.
1517 Specifies how the red, green, blue, and alpha destination blending
1518 factors are computed. The following symbolic constants are
1519 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1520 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1521 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1522 `GL_ONE_MINUS_DST_ALPHA'. `GL_CONSTANT_COLOR',
1523 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA', and
1524 `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial value is `GL_ZERO'.
1526 In RGBA mode, pixels can be drawn using a function that blends the
1527 incoming (source) RGBA values with the RGBA values that are already in
1528 the frame buffer (the destination values). Blending is initially
1529 disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1530 enable and disable blending.
1532 `glBlendFunc' defines the operation of blending when it is enabled.
1533 SFACTOR specifies which method is used to scale the source color
1534 components. DFACTOR specifies which method is used to scale the
1535 destination color components. The possible methods are described in the
1536 following table. Each method defines four scale factors, one each for
1537 red, green, blue, and alpha. In the table and in subsequent equations,
1538 source and destination color components are referred to as
1539 (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The color specified by
1540 `glBlendColor' is referred to as (R_C,G_CB_CA_C) . They are understood
1541 to have integer values between 0 and (K_R,K_GK_BK_A) , where
1545 and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1548 Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1549 and (D_R,D_GD_BD_A) . The scale factors described in the table, denoted
1550 (F_R,F_GF_BF_A) , represent either source or destination factors. All
1551 scale factors have range [0,1] .
1565 (R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1567 `GL_ONE_MINUS_SRC_COLOR'
1568 (1,111)-(R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1571 (R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1573 `GL_ONE_MINUS_DST_COLOR'
1574 (1,111)-(R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1577 (A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1579 `GL_ONE_MINUS_SRC_ALPHA'
1580 (1,111)-(A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1583 (A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1585 `GL_ONE_MINUS_DST_ALPHA'
1586 (1,111)-(A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1591 `GL_ONE_MINUS_CONSTANT_COLOR'
1592 (1,111)-(R_C,G_CB_CA_C)
1597 `GL_ONE_MINUS_CONSTANT_ALPHA'
1598 (1,111)-(A_C,A_CA_CA_C)
1600 `GL_SRC_ALPHA_SATURATE'
1605 I=MIN\u2061(A_S,K_A-A_D)/K_A
1607 To determine the blended RGBA values of a pixel when drawing in RGBA
1608 mode, the system uses the following equations:
1610 R_D=MIN\u2061(K_R,R_S\u2062S_R+R_D\u2062D_R) G_D=MIN\u2061(K_G,G_S\u2062S_G+G_D\u2062D_G)
1611 B_D=MIN\u2061(K_B,B_S\u2062S_B+B_D\u2062D_B) A_D=MIN\u2061(K_A,A_S\u2062S_A+A_D\u2062D_A)
1613 Despite the apparent precision of the above equations, blending
1614 arithmetic is not exactly specified, because blending operates with
1615 imprecise integer color values. However, a blend factor that should be
1616 equal to 1 is guaranteed not to modify its multiplicand, and a blend
1617 factor equal to 0 reduces its multiplicand to 0. For example, when
1618 SFACTOR is `GL_SRC_ALPHA', DFACTOR is `GL_ONE_MINUS_SRC_ALPHA', and A_S
1619 is equal to K_A , the equations reduce to simple replacement:
1621 R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1625 `GL_INVALID_ENUM' is generated if either SFACTOR or DFACTOR is not an
1628 `GL_INVALID_OPERATION' is generated if `glBlendFunc' is executed between
1629 the execution of `glBegin' and the corresponding execution of `glEnd'.")
1631 (define-gl-procedures
1635 (data const-GLvoid-*)
1639 "Creates and initializes a buffer object's data store.
1642 Specifies the target buffer object. The symbolic constant must be
1643 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1644 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1647 Specifies the size in bytes of the buffer object's new data store.
1650 Specifies a pointer to data that will be copied into the data store
1651 for initialization, or `NULL' if no data is to be copied.
1654 Specifies the expected usage pattern of the data store. The
1655 symbolic constant must be `GL_STREAM_DRAW', `GL_STREAM_READ',
1656 `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1657 `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1660 `glBufferData' creates a new data store for the buffer object currently
1661 bound to TARGET. Any pre-existing data store is deleted. The new data
1662 store is created with the specified SIZE in bytes and USAGE. If DATA is
1663 not `NULL', the data store is initialized with data from this pointer.
1664 In its initial state, the new data store is not mapped, it has a `NULL'
1665 mapped pointer, and its mapped access is `GL_READ_WRITE'.
1667 USAGE is a hint to the GL implementation as to how a buffer object's
1668 data store will be accessed. This enables the GL implementation to make
1669 more intelligent decisions that may significantly impact buffer object
1670 performance. It does not, however, constrain the actual usage of the
1671 data store. USAGE can be broken down into two parts: first, the
1672 frequency of access (modification and usage), and second, the nature of
1673 that access. The frequency of access may be one of these:
1676 The data store contents will be modified once and used at most a
1680 The data store contents will be modified once and used many times.
1683 The data store contents will be modified repeatedly and used many
1686 The nature of access may be one of these:
1689 The data store contents are modified by the application, and used
1690 as the source for GL drawing and image specification commands.
1693 The data store contents are modified by reading data from the GL,
1694 and used to return that data when queried by the application.
1697 The data store contents are modified by reading data from the GL,
1698 and used as the source for GL drawing and image specification
1701 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1702 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1703 `GL_PIXEL_UNPACK_BUFFER'.
1705 `GL_INVALID_ENUM' is generated if USAGE is not `GL_STREAM_DRAW',
1706 `GL_STREAM_READ', `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1707 `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1710 `GL_INVALID_VALUE' is generated if SIZE is negative.
1712 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1715 `GL_OUT_OF_MEMORY' is generated if the GL is unable to create a data
1716 store with the specified SIZE.
1718 `GL_INVALID_OPERATION' is generated if `glBufferData' is executed
1719 between the execution of `glBegin' and the corresponding execution of
1722 (define-gl-procedures
1727 (data const-GLvoid-*)
1730 "Updates a subset of a buffer object's data store.
1733 Specifies the target buffer object. The symbolic constant must be
1734 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1735 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1738 Specifies the offset into the buffer object's data store where data
1739 replacement will begin, measured in bytes.
1742 Specifies the size in bytes of the data store region being
1746 Specifies a pointer to the new data that will be copied into the
1749 `glBufferSubData' redefines some or all of the data store for the buffer
1750 object currently bound to TARGET. Data starting at byte offset OFFSET
1751 and extending for SIZE bytes is copied to the data store from the memory
1752 pointed to by DATA. An error is thrown if OFFSET and SIZE together
1753 define a range beyond the bounds of the buffer object's data store.
1755 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1756 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1757 `GL_PIXEL_UNPACK_BUFFER'.
1759 `GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
1760 together they define a region of memory that extends beyond the buffer
1761 object's allocated data store.
1763 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1766 `GL_INVALID_OPERATION' is generated if the buffer object being updated
1769 `GL_INVALID_OPERATION' is generated if `glBufferSubData' is executed
1770 between the execution of `glBegin' and the corresponding execution of
1773 (define-gl-procedures
1777 (lists const-GLvoid-*)
1780 "Execute a list of display lists.
1783 Specifies the number of display lists to be executed.
1786 Specifies the type of values in LISTS. Symbolic constants
1787 `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT',
1788 `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES',
1789 `GL_3_BYTES', and `GL_4_BYTES' are accepted.
1792 Specifies the address of an array of name offsets in the display
1793 list. The pointer type is void because the offsets can be bytes,
1794 shorts, ints, or floats, depending on the value of TYPE.
1796 `glCallLists' causes each display list in the list of names passed as
1797 LISTS to be executed. As a result, the commands saved in each display
1798 list are executed in order, just as if they were called without using a
1799 display list. Names of display lists that have not been defined are
1802 `glCallLists' provides an efficient means for executing more than one
1803 display list. TYPE allows lists with various name formats to be
1804 accepted. The formats are as follows:
1807 LISTS is treated as an array of signed bytes, each in the range
1811 LISTS is treated as an array of unsigned bytes, each in the range 0
1815 LISTS is treated as an array of signed two-byte integers, each in
1816 the range -32768 through 32767.
1819 LISTS is treated as an array of unsigned two-byte integers, each in
1820 the range 0 through 65535.
1823 LISTS is treated as an array of signed four-byte integers.
1826 LISTS is treated as an array of unsigned four-byte integers.
1829 LISTS is treated as an array of four-byte floating-point values.
1832 LISTS is treated as an array of unsigned bytes. Each pair of bytes
1833 specifies a single display-list name. The value of the pair is
1834 computed as 256 times the unsigned value of the first byte plus the
1835 unsigned value of the second byte.
1838 LISTS is treated as an array of unsigned bytes. Each triplet of
1839 bytes specifies a single display-list name. The value of the
1840 triplet is computed as 65536 times the unsigned value of the first
1841 byte, plus 256 times the unsigned value of the second byte, plus
1842 the unsigned value of the third byte.
1845 LISTS is treated as an array of unsigned bytes. Each quadruplet of
1846 bytes specifies a single display-list name. The value of the
1847 quadruplet is computed as 16777216 times the unsigned value of the
1848 first byte, plus 65536 times the unsigned value of the second byte,
1849 plus 256 times the unsigned value of the third byte, plus the
1850 unsigned value of the fourth byte.
1852 The list of display-list names is not null-terminated. Rather, N
1853 specifies how many names are to be taken from LISTS.
1855 An additional level of indirection is made available with the
1856 `glListBase' command, which specifies an unsigned offset that is added
1857 to each display-list name specified in LISTS before that display list is
1860 `glCallLists' can appear inside a display list. To avoid the possibility
1861 of infinite recursion resulting from display lists calling one another,
1862 a limit is placed on the nesting level of display lists during
1863 display-list execution. This limit must be at least 64, and it depends
1864 on the implementation.
1866 GL state is not saved and restored across a call to `glCallLists'. Thus,
1867 changes made to GL state during the execution of the display lists
1868 remain after execution is completed. Use `glPushAttrib', `glPopAttrib',
1869 `glPushMatrix', and `glPopMatrix' to preserve GL state across
1870 `glCallLists' calls.
1872 `GL_INVALID_VALUE' is generated if N is negative.
1874 `GL_INVALID_ENUM' is generated if TYPE is not one of `GL_BYTE',
1875 `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT', `GL_INT',
1876 `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES', `GL_3_BYTES', `GL_4_BYTES'.")
1878 (define-gl-procedures
1879 ((glCallList (list GLuint) -> void))
1880 "Execute a display list.
1883 Specifies the integer name of the display list to be executed.
1885 `glCallList' causes the named display list to be executed. The commands
1886 saved in the display list are executed in order, just as if they were
1887 called without using a display list. If LIST has not been defined as a
1888 display list, `glCallList' is ignored.
1890 `glCallList' can appear inside a display list. To avoid the possibility
1891 of infinite recursion resulting from display lists calling one another,
1892 a limit is placed on the nesting level of display lists during
1893 display-list execution. This limit is at least 64, and it depends on the
1896 GL state is not saved and restored across a call to `glCallList'. Thus,
1897 changes made to GL state during the execution of a display list remain
1898 after execution of the display list is completed. Use `glPushAttrib',
1899 `glPopAttrib', `glPushMatrix', and `glPopMatrix' to preserve GL state
1900 across `glCallList' calls.")
1902 (define-gl-procedures
1910 "Specify clear values for the accumulation buffer.
1919 Specify the red, green, blue, and alpha values used when the
1920 accumulation buffer is cleared. The initial values are all 0.
1922 `glClearAccum' specifies the red, green, blue, and alpha values used by
1923 `glClear' to clear the accumulation buffer.
1925 Values specified by `glClearAccum' are clamped to the range [-1,1] .
1927 `GL_INVALID_OPERATION' is generated if `glClearAccum' is executed
1928 between the execution of `glBegin' and the corresponding execution of
1931 (define-gl-procedures
1939 "Specify clear values for the color buffers.
1948 Specify the red, green, blue, and alpha values used when the color
1949 buffers are cleared. The initial values are all 0.
1951 `glClearColor' specifies the red, green, blue, and alpha values used by
1952 `glClear' to clear the color buffers. Values specified by `glClearColor'
1953 are clamped to the range [0,1] .
1955 `GL_INVALID_OPERATION' is generated if `glClearColor' is executed
1956 between the execution of `glBegin' and the corresponding execution of
1959 (define-gl-procedures
1960 ((glClearDepth (depth GLclampd) -> void))
1961 "Specify the clear value for the depth buffer.
1964 Specifies the depth value used when the depth buffer is cleared.
1965 The initial value is 1.
1967 `glClearDepth' specifies the depth value used by `glClear' to clear the
1968 depth buffer. Values specified by `glClearDepth' are clamped to the
1971 `GL_INVALID_OPERATION' is generated if `glClearDepth' is executed
1972 between the execution of `glBegin' and the corresponding execution of
1975 (define-gl-procedures
1976 ((glClearIndex (c GLfloat) -> void))
1977 "Specify the clear value for the color index buffers.
1980 Specifies the index used when the color index buffers are cleared.
1981 The initial value is 0.
1983 `glClearIndex' specifies the index used by `glClear' to clear the color
1984 index buffers. C is not clamped. Rather, C is converted to a fixed-point
1985 value with unspecified precision to the right of the binary point. The
1986 integer part of this value is then masked with 2^M-1 , where M is the
1987 number of bits in a color index stored in the frame buffer.
1989 `GL_INVALID_OPERATION' is generated if `glClearIndex' is executed
1990 between the execution of `glBegin' and the corresponding execution of
1993 (define-gl-procedures
1994 ((glClearStencil (s GLint) -> void))
1995 "Specify the clear value for the stencil buffer.
1998 Specifies the index used when the stencil buffer is cleared. The
2001 `glClearStencil' specifies the index used by `glClear' to clear the
2002 stencil buffer. S is masked with 2^M-1 , where M is the number of bits
2003 in the stencil buffer.
2005 `GL_INVALID_OPERATION' is generated if `glClearStencil' is executed
2006 between the execution of `glBegin' and the corresponding execution of
2009 (define-gl-procedures
2010 ((glClear (mask GLbitfield) -> void))
2011 "Clear buffers to preset values.
2014 Bitwise OR of masks that indicate the buffers to be cleared. The
2015 four masks are `GL_COLOR_BUFFER_BIT', `GL_DEPTH_BUFFER_BIT',
2016 `GL_ACCUM_BUFFER_BIT', and `GL_STENCIL_BUFFER_BIT'.
2018 `glClear' sets the bitplane area of the window to values previously
2019 selected by `glClearColor', `glClearIndex', `glClearDepth',
2020 `glClearStencil', and `glClearAccum'. Multiple color buffers can be
2021 cleared simultaneously by selecting more than one buffer at a time using
2024 The pixel ownership test, the scissor test, dithering, and the buffer
2025 writemasks affect the operation of `glClear'. The scissor box bounds the
2026 cleared region. Alpha function, blend function, logical operation,
2027 stenciling, texture mapping, and depth-buffering are ignored by
2030 `glClear' takes a single argument that is the bitwise OR of several
2031 values indicating which buffer is to be cleared.
2033 The values are as follows:
2035 `GL_COLOR_BUFFER_BIT'
2036 Indicates the buffers currently enabled for color writing.
2038 `GL_DEPTH_BUFFER_BIT'
2039 Indicates the depth buffer.
2041 `GL_ACCUM_BUFFER_BIT'
2042 Indicates the accumulation buffer.
2044 `GL_STENCIL_BUFFER_BIT'
2045 Indicates the stencil buffer.
2047 The value to which each buffer is cleared depends on the setting of the
2048 clear value for that buffer.
2050 `GL_INVALID_VALUE' is generated if any bit other than the four defined
2051 bits is set in MASK.
2053 `GL_INVALID_OPERATION' is generated if `glClear' is executed between the
2054 execution of `glBegin' and the corresponding execution of `glEnd'.")
2056 (define-gl-procedures
2057 ((glClientActiveTexture (texture GLenum) -> void))
2058 "Select active texture unit.
2061 Specifies which texture unit to make active. The number of texture
2062 units is implementation dependent, but must be at least two.
2063 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
2064 the value of `GL_MAX_TEXTURE_COORDS' - 1, which is an
2065 implementation-dependent value. The initial value is `GL_TEXTURE0'.
2067 `glClientActiveTexture' selects the vertex array client state parameters
2068 to be modified by `glTexCoordPointer', and enabled or disabled with
2069 `glEnableClientState' or `glDisableClientState', respectively, when
2070 called with a parameter of `GL_TEXTURE_COORD_ARRAY'.
2072 `GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
2073 where i ranges from 0 to the value of `GL_MAX_TEXTURE_COORDS' - 1.")
2075 (define-gl-procedures
2078 (equation const-GLdouble-*)
2081 "Specify a plane against which all geometry is clipped.
2084 Specifies which clipping plane is being positioned. Symbolic names
2085 of the form `GL_CLIP_PLANE'I, where I is an integer between 0 and
2086 `GL_MAX_CLIP_PLANES' -1 , are accepted.
2089 Specifies the address of an array of four double-precision
2090 floating-point values. These values are interpreted as a plane
2093 Geometry is always clipped against the boundaries of a six-plane frustum
2094 in X, Y, and Z. `glClipPlane' allows the specification of additional
2095 planes, not necessarily perpendicular to the X, Y, or Z axis, against
2096 which all geometry is clipped. To determine the maximum number of
2097 additional clipping planes, call `glGetIntegerv' with argument
2098 `GL_MAX_CLIP_PLANES'. All implementations support at least six such
2099 clipping planes. Because the resulting clipping region is the
2100 intersection of the defined half-spaces, it is always convex.
2102 `glClipPlane' specifies a half-space using a four-component plane
2103 equation. When `glClipPlane' is called, EQUATION is transformed by the
2104 inverse of the modelview matrix and stored in the resulting eye
2105 coordinates. Subsequent changes to the modelview matrix have no effect
2106 on the stored plane-equation components. If the dot product of the eye
2107 coordinates of a vertex with the stored plane equation components is
2108 positive or zero, the vertex is IN with respect to that clipping plane.
2109 Otherwise, it is OUT.
2111 To enable and disable clipping planes, call `glEnable' and `glDisable'
2112 with the argument `GL_CLIP_PLANE'I, where I is the plane number.
2114 All clipping planes are initially defined as (0, 0, 0, 0) in eye
2115 coordinates and are disabled.
2117 `GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
2119 `GL_INVALID_OPERATION' is generated if `glClipPlane' is executed between
2120 the execution of `glBegin' and the corresponding execution of `glEnd'.")
2122 (define-gl-procedures
2130 "Enable and disable writing of frame buffer color components.
2139 Specify whether red, green, blue, and alpha can or cannot be
2140 written into the frame buffer. The initial values are all
2141 `GL_TRUE', indicating that the color components can be written.
2143 `glColorMask' specifies whether the individual color components in the
2144 frame buffer can or cannot be written. If RED is `GL_FALSE', for
2145 example, no change is made to the red component of any pixel in any of
2146 the color buffers, regardless of the drawing operation attempted.
2148 Changes to individual bits of components cannot be controlled. Rather,
2149 changes are either enabled or disabled for entire color components.
2151 `GL_INVALID_OPERATION' is generated if `glColorMask' is executed between
2152 the execution of `glBegin' and the corresponding execution of `glEnd'.")
2154 (define-gl-procedures
2160 "Cause a material color to track the current color.
2163 Specifies whether front, back, or both front and back material
2164 parameters should track the current color. Accepted values are
2165 `GL_FRONT', `GL_BACK', and `GL_FRONT_AND_BACK'. The initial value
2166 is `GL_FRONT_AND_BACK'.
2169 Specifies which of several material parameters track the current
2170 color. Accepted values are `GL_EMISSION', `GL_AMBIENT',
2171 `GL_DIFFUSE', `GL_SPECULAR', and `GL_AMBIENT_AND_DIFFUSE'. The
2172 initial value is `GL_AMBIENT_AND_DIFFUSE'.
2174 `glColorMaterial' specifies which material parameters track the current
2175 color. When `GL_COLOR_MATERIAL' is enabled, the material parameter or
2176 parameters specified by MODE, of the material or materials specified by
2177 FACE, track the current color at all times.
2179 To enable and disable `GL_COLOR_MATERIAL', call `glEnable' and
2180 `glDisable' with argument `GL_COLOR_MATERIAL'. `GL_COLOR_MATERIAL' is
2183 `GL_INVALID_ENUM' is generated if FACE or MODE is not an accepted value.
2185 `GL_INVALID_OPERATION' is generated if `glColorMaterial' is executed
2186 between the execution of `glBegin' and the corresponding execution of
2189 (define-gl-procedures
2194 (pointer const-GLvoid-*)
2197 "Define an array of colors.
2200 Specifies the number of components per color. Must be 3 or 4. The
2204 Specifies the data type of each color component in the array.
2205 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
2206 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', and
2207 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
2210 Specifies the byte offset between consecutive colors. If STRIDE is
2211 0, the colors are understood to be tightly packed in the array. The
2215 Specifies a pointer to the first component of the first color
2216 element in the array. The initial value is 0.
2218 `glColorPointer' specifies the location and data format of an array of
2219 color components to use when rendering. SIZE specifies the number of
2220 components per color, and must be 3 or 4. TYPE specifies the data type
2221 of each color component, and STRIDE specifies the byte stride from one
2222 color to the next, allowing vertices and attributes to be packed into a
2223 single array or stored in separate arrays. (Single-array storage may be
2224 more efficient on some implementations; see `glInterleavedArrays'.)
2226 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
2227 target (see `glBindBuffer') while a color array is specified, POINTER is
2228 treated as a byte offset into the buffer object's data store. Also, the
2229 buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as color
2230 vertex array client-side state (`GL_COLOR_ARRAY_BUFFER_BINDING').
2232 When a color array is specified, SIZE, TYPE, STRIDE, and POINTER are
2233 saved as client-side state, in addition to the current vertex array
2234 buffer object binding.
2236 To enable and disable the color array, call `glEnableClientState' and
2237 `glDisableClientState' with the argument `GL_COLOR_ARRAY'. If enabled,
2238 the color array is used when `glDrawArrays', `glMultiDrawArrays',
2239 `glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
2240 `glArrayElement' is called.
2242 `GL_INVALID_VALUE' is generated if SIZE is not 3 or 4.
2244 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
2246 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
2248 (define-gl-procedures
2255 (data const-GLvoid-*)
2258 "Respecify a portion of a color table.
2261 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2262 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2265 The starting index of the portion of the color table to be
2269 The number of table entries to replace.
2272 The format of the pixel data in DATA. The allowable values are
2273 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2274 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
2277 The type of the pixel data in DATA. The allowable values are
2278 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2279 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2280 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2281 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2282 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2283 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2284 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2285 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2288 Pointer to a one-dimensional array of pixel data that is processed
2289 to replace the specified region of the color table.
2291 `glColorSubTable' is used to respecify a contiguous portion of a color
2292 table previously defined using `glColorTable'. The pixels referenced by
2293 DATA replace the portion of the existing table from indices START to
2294 START+COUNT-1 , inclusive. This region may not include any entries
2295 outside the range of the color table as it was originally specified. It
2296 is not an error to specify a subtexture with width of 0, but such a
2297 specification has no effect.
2299 If a non-zero named buffer object is bound to the
2300 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a portion of
2301 a color table is respecified, DATA is treated as a byte offset into the
2302 buffer object's data store.
2304 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2307 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2310 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2313 `GL_INVALID_VALUE' is generated if START+COUNT>WIDTH .
2315 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2316 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2317 data store is currently mapped.
2319 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2320 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2321 unpacked from the buffer object such that the memory reads required
2322 would exceed the data store size.
2324 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2325 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2326 divisible into the number of bytes needed to store in memory a datum
2329 `GL_INVALID_OPERATION' is generated if `glColorSubTable' is executed
2330 between the execution of `glBegin' and the corresponding execution of
2333 (define-gl-procedures
2336 (internalformat GLenum)
2340 (data const-GLvoid-*)
2343 "Define a color lookup table.
2346 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2347 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `GL_PROXY_COLOR_TABLE',
2348 `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
2349 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
2352 The internal format of the color table. The allowable values are
2353 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
2354 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
2355 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
2356 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
2357 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
2358 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
2359 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
2360 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
2361 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
2362 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', and `GL_RGBA16'.
2365 The number of entries in the color lookup table specified by DATA.
2368 The format of the pixel data in DATA. The allowable values are
2369 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2370 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
2373 The type of the pixel data in DATA. The allowable values are
2374 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2375 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2376 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2377 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2378 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2379 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2380 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2381 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2384 Pointer to a one-dimensional array of pixel data that is processed
2385 to build the color table.
2387 `glColorTable' may be used in two ways: to test the actual size and
2388 color resolution of a lookup table given a particular set of parameters,
2389 or to load the contents of a color lookup table. Use the targets
2390 `GL_PROXY_*' for the first case and the other targets for the second
2393 If a non-zero named buffer object is bound to the
2394 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a color table
2395 is specified, DATA is treated as a byte offset into the buffer object's
2398 If TARGET is `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
2399 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `glColorTable' builds a color lookup
2400 table from an array of pixels. The pixel array specified by WIDTH,
2401 FORMAT, TYPE, and DATA is extracted from memory and processed just as if
2402 `glDrawPixels' were called, but processing stops after the final
2403 expansion to RGBA is completed.
2405 The four scale parameters and the four bias parameters that are defined
2406 for the table are then used to scale and bias the R, G, B, and A
2407 components of each pixel. (Use `glColorTableParameter' to set these
2408 scale and bias parameters.)
2410 Next, the R, G, B, and A values are clamped to the range [0,1] . Each
2411 pixel is then converted to the internal format specified by
2412 INTERNALFORMAT. This conversion simply maps the component values of the
2413 pixel (R, G, B, and A) to the values included in the internal format
2414 (red, green, blue, alpha, luminance, and intensity). The mapping is as
2420 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
2428 `GL_LUMINANCE_ALPHA'
2440 Finally, the red, green, blue, alpha, luminance, and/or intensity
2441 components of the resulting pixels are stored in the color table. They
2442 form a one-dimensional table with indices in the range [0,WIDTH-1] .
2444 If TARGET is `GL_PROXY_*', `glColorTable' recomputes and stores the
2445 values of the proxy color table's state variables
2446 `GL_COLOR_TABLE_FORMAT', `GL_COLOR_TABLE_WIDTH',
2447 `GL_COLOR_TABLE_RED_SIZE', `GL_COLOR_TABLE_GREEN_SIZE',
2448 `GL_COLOR_TABLE_BLUE_SIZE', `GL_COLOR_TABLE_ALPHA_SIZE',
2449 `GL_COLOR_TABLE_LUMINANCE_SIZE', and `GL_COLOR_TABLE_INTENSITY_SIZE'.
2450 There is no effect on the image or state of any actual color table. If
2451 the specified color table is too large to be supported, then all the
2452 proxy state variables listed above are set to zero. Otherwise, the color
2453 table could be supported by `glColorTable' using the corresponding
2454 non-proxy target, and the proxy state variables are set as if that
2455 target were being defined.
2457 The proxy state variables can be retrieved by calling
2458 `glGetColorTableParameter' with a target of `GL_PROXY_*'. This allows
2459 the application to decide if a particular `glColorTable' command would
2460 succeed, and to determine what the resulting color table attributes
2463 If a color table is enabled, and its width is non-zero, then its
2464 contents are used to replace a subset of the components of each RGBA
2465 pixel group, based on the internal format of the table.
2467 Each pixel group has color components (R, G, B, A) that are in the range
2468 [0.0,1.0] . The color components are rescaled to the size of the color
2469 lookup table to form an index. Then a subset of the components based on
2470 the internal format of the table are replaced by the table entry
2471 selected by that index. If the color components and contents of the
2472 table are represented as follows:
2480 Table index computed from `R'
2483 Table index computed from `G'
2486 Table index computed from `B'
2489 Table index computed from `A'
2492 Luminance value at table index `i'
2495 Intensity value at table index `i'
2498 Red value at table index `i'
2501 Green value at table index `i'
2504 Blue value at table index `i'
2507 Alpha value at table index `i'
2509 then the result of color table lookup is as follows:
2514 *Resulting Texture Components*
2516 *Table Internal Format*
2520 `R', `G', `B', `A[a]'
2523 `L[r]', `L[g]', `L[b]', `At'
2525 `GL_LUMINANCE_ALPHA'
2526 `L[r]', `L[g]', `L[b]', `A[a]'
2529 `I[r]', `I[g]', `I[b]', `I[a]'
2532 `R[r]', `G[g]', `B[b]', `A'
2535 `R[r]', `G[g]', `B[b]', `A[a]'
2537 When `GL_COLOR_TABLE' is enabled, the colors resulting from the pixel
2538 map operation (if it is enabled) are mapped by the color lookup table
2539 before being passed to the convolution operation. The colors resulting
2540 from the convolution operation are modified by the post convolution
2541 color lookup table when `GL_POST_CONVOLUTION_COLOR_TABLE' is enabled.
2542 These modified colors are then sent to the color matrix operation.
2543 Finally, if `GL_POST_COLOR_MATRIX_COLOR_TABLE' is enabled, the colors
2544 resulting from the color matrix operation are mapped by the post color
2545 matrix color lookup table before being used by the histogram operation.
2549 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2552 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
2555 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2558 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2561 `GL_INVALID_VALUE' is generated if WIDTH is less than zero.
2563 `GL_TABLE_TOO_LARGE' is generated if the requested color table is too
2564 large to be supported by the implementation, and TARGET is not a
2565 `GL_PROXY_*' target.
2567 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2568 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2569 data store is currently mapped.
2571 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2572 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2573 unpacked from the buffer object such that the memory reads required
2574 would exceed the data store size.
2576 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2577 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2578 divisible into the number of bytes needed to store in memory a datum
2581 `GL_INVALID_OPERATION' is generated if `glColorTable' is executed
2582 between the execution of `glBegin' and the corresponding execution of
2585 (define-gl-procedures
2625 "Set the current color.
2632 Specify new red, green, and blue values for the current color.
2635 Specifies a new alpha value for the current color. Included only in
2636 the four-argument `glColor4' commands.
2638 The GL stores both a current single-valued color index and a current
2639 four-valued RGBA color. `glColor' sets a new four-valued RGBA color.
2640 `glColor' has two major variants: `glColor3' and `glColor4'. `glColor3'
2641 variants specify new red, green, and blue values explicitly and set the
2642 current alpha value to 1.0 (full intensity) implicitly. `glColor4'
2643 variants specify all four color components explicitly.
2645 `glColor3b', `glColor4b', `glColor3s', `glColor4s', `glColor3i', and
2646 `glColor4i' take three or four signed byte, short, or long integers as
2647 arguments. When *v* is appended to the name, the color commands can take
2648 a pointer to an array of such values.
2650 Current color values are stored in floating-point format, with
2651 unspecified mantissa and exponent sizes. Unsigned integer color
2652 components, when specified, are linearly mapped to floating-point values
2653 such that the largest representable value maps to 1.0 (full intensity),
2654 and 0 maps to 0.0 (zero intensity). Signed integer color components,
2655 when specified, are linearly mapped to floating-point values such that
2656 the most positive representable value maps to 1.0, and the most negative
2657 representable value maps to -1.0 . (Note that this mapping does not
2658 convert 0 precisely to 0.0.) Floating-point values are mapped directly.
2660 Neither floating-point nor signed integer values are clamped to the
2661 range [0,1] before the current color is updated. However, color
2662 components are clamped to this range before they are interpolated or
2663 written into a color buffer.")
2665 (define-gl-procedures
2666 ((glCompileShader (shader GLuint) -> void))
2667 "Compiles a shader object.
2670 Specifies the shader object to be compiled.
2672 `glCompileShader' compiles the source code strings that have been stored
2673 in the shader object specified by SHADER.
2675 The compilation status will be stored as part of the shader object's
2676 state. This value will be set to `GL_TRUE' if the shader was compiled
2677 without errors and is ready for use, and `GL_FALSE' otherwise. It can be
2678 queried by calling `glGetShader' with arguments SHADER and
2679 `GL_COMPILE_STATUS'.
2681 Compilation of a shader can fail for a number of reasons as specified by
2682 the OpenGL Shading Language Specification. Whether or not the
2683 compilation was successful, information about the compilation can be
2684 obtained from the shader object's information log by calling
2685 `glGetShaderInfoLog'.
2687 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
2690 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
2692 `GL_INVALID_OPERATION' is generated if `glCompileShader' is executed
2693 between the execution of `glBegin' and the corresponding execution of
2696 (define-gl-procedures
2697 ((glCompressedTexImage1D
2700 (internalformat GLenum)
2704 (data const-GLvoid-*)
2707 "Specify a one-dimensional texture image in a compressed format.
2710 Specifies the target texture. Must be `GL_TEXTURE_1D' or
2711 `GL_PROXY_TEXTURE_1D'.
2714 Specifies the level-of-detail number. Level 0 is the base image
2715 level. Level N is the Nth mipmap reduction image.
2718 Specifies the format of the compressed image data stored at address
2722 Specifies the width of the texture image including the border if
2723 any. If the GL version does not support non-power-of-two sizes,
2724 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2725 implementations support texture images that are at least 64 texels
2726 wide. The height of the 1D texture image is 1.
2729 Specifies the width of the border. Must be either 0 or 1.
2732 Specifies the number of unsigned bytes of image data starting at
2733 the address specified by DATA.
2736 Specifies a pointer to the compressed image data in memory.
2738 Texturing maps a portion of a specified texture image onto each
2739 graphical primitive for which texturing is enabled. To enable and
2740 disable one-dimensional texturing, call `glEnable' and `glDisable' with
2741 argument `GL_TEXTURE_1D'.
2743 `glCompressedTexImage1D' loads a previously defined, and retrieved,
2744 compressed one-dimensional texture image if TARGET is `GL_TEXTURE_1D'
2745 (see `glTexImage1D').
2747 If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
2748 of the texture image state is recalculated, checked for consistency, and
2749 checked against the implementation's capabilities. If the implementation
2750 cannot handle a texture of the requested texture size, it sets all of
2751 the image state to 0, but does not generate an error (see `glGetError').
2752 To query for an entire mipmap array, use an image array level greater
2755 INTERNALFORMAT must be extension-specified compressed-texture format.
2756 When a texture is loaded with `glTexImage1D' using a generic compressed
2757 texture format (e.g., `GL_COMPRESSED_RGB') the GL selects from one of
2758 its extensions supporting compressed textures. In order to load the
2759 compressed texture image using `glCompressedTexImage1D', query the
2760 compressed texture image's size and format using
2761 `glGetTexLevelParameter'.
2763 If a non-zero named buffer object is bound to the
2764 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2765 image is specified, DATA is treated as a byte offset into the buffer
2766 object's data store.
2768 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2769 compressed internal formats: `GL_COMPRESSED_ALPHA',
2770 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2771 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2773 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
2774 format, dimensions, and contents of the specified compressed image data.
2776 `GL_INVALID_OPERATION' is generated if parameter combinations are not
2777 supported by the specific compressed internal format as specified in the
2778 specific texture compression extension.
2780 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2781 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2782 data store is currently mapped.
2784 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2785 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2786 unpacked from the buffer object such that the memory reads required
2787 would exceed the data store size.
2789 `GL_INVALID_OPERATION' is generated if `glCompressedTexImage1D' is
2790 executed between the execution of `glBegin' and the corresponding
2791 execution of `glEnd'.
2793 Undefined results, including abnormal program termination, are generated
2794 if DATA is not encoded in a manner consistent with the extension
2795 specification defining the internal compression format.")
2797 (define-gl-procedures
2798 ((glCompressedTexImage2D
2801 (internalformat GLenum)
2806 (data const-GLvoid-*)
2809 "Specify a two-dimensional texture image in a compressed format.
2812 Specifies the target texture. Must be `GL_TEXTURE_2D',
2813 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
2814 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
2815 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
2816 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
2819 Specifies the level-of-detail number. Level 0 is the base image
2820 level. Level N is the Nth mipmap reduction image.
2823 Specifies the format of the compressed image data stored at address
2827 Specifies the width of the texture image including the border if
2828 any. If the GL version does not support non-power-of-two sizes,
2829 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2830 implementations support 2D texture images that are at least 64
2831 texels wide and cube-mapped texture images that are at least 16
2835 Specifies the height of the texture image including the border if
2836 any. If the GL version does not support non-power-of-two sizes,
2837 this value must be Must be 2^N+2\u2061(BORDER,) for some integer N . All
2838 implementations support 2D texture images that are at least 64
2839 texels high and cube-mapped texture images that are at least 16
2843 Specifies the width of the border. Must be either 0 or 1.
2846 Specifies the number of unsigned bytes of image data starting at
2847 the address specified by DATA.
2850 Specifies a pointer to the compressed image data in memory.
2852 Texturing maps a portion of a specified texture image onto each
2853 graphical primitive for which texturing is enabled. To enable and
2854 disable two-dimensional texturing, call `glEnable' and `glDisable' with
2855 argument `GL_TEXTURE_2D'. To enable and disable texturing using
2856 cube-mapped textures, call `glEnable' and `glDisable' with argument
2857 `GL_TEXTURE_CUBE_MAP'.
2859 `glCompressedTexImage2D' loads a previously defined, and retrieved,
2860 compressed two-dimensional texture image if TARGET is `GL_TEXTURE_2D'
2861 (see `glTexImage2D').
2863 If TARGET is `GL_PROXY_TEXTURE_2D', no data is read from DATA, but all
2864 of the texture image state is recalculated, checked for consistency, and
2865 checked against the implementation's capabilities. If the implementation
2866 cannot handle a texture of the requested texture size, it sets all of
2867 the image state to 0, but does not generate an error (see `glGetError').
2868 To query for an entire mipmap array, use an image array level greater
2871 INTERNALFORMAT must be an extension-specified compressed-texture format.
2872 When a texture is loaded with `glTexImage2D' using a generic compressed
2873 texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
2874 its extensions supporting compressed textures. In order to load the
2875 compressed texture image using `glCompressedTexImage2D', query the
2876 compressed texture image's size and format using
2877 `glGetTexLevelParameter'.
2879 If a non-zero named buffer object is bound to the
2880 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2881 image is specified, DATA is treated as a byte offset into the buffer
2882 object's data store.
2884 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2885 compressed internal formats: `GL_COMPRESSED_ALPHA',
2886 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2887 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2889 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
2890 format, dimensions, and contents of the specified compressed image data.
2892 `GL_INVALID_OPERATION' is generated if parameter combinations are not
2893 supported by the specific compressed internal format as specified in the
2894 specific texture compression extension.
2896 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2897 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2898 data store is currently mapped.
2900 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2901 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2902 unpacked from the buffer object such that the memory reads required
2903 would exceed the data store size.
2905 `GL_INVALID_OPERATION' is generated if `glCompressedTexImage2D' is
2906 executed between the execution of `glBegin' and the corresponding
2907 execution of `glEnd'.
2909 Undefined results, including abnormal program termination, are generated
2910 if DATA is not encoded in a manner consistent with the extension
2911 specification defining the internal compression format.")
2913 (define-gl-procedures
2914 ((glCompressedTexImage3D
2917 (internalformat GLenum)
2923 (data const-GLvoid-*)
2926 "Specify a three-dimensional texture image in a compressed format.
2929 Specifies the target texture. Must be `GL_TEXTURE_3D' or
2930 `GL_PROXY_TEXTURE_3D'.
2933 Specifies the level-of-detail number. Level 0 is the base image
2934 level. Level N is the Nth mipmap reduction image.
2937 Specifies the format of the compressed image data stored at address
2941 Specifies the width of the texture image including the border if
2942 any. If the GL version does not support non-power-of-two sizes,
2943 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2944 implementations support 3D texture images that are at least 16
2948 Specifies the height of the texture image including the border if
2949 any. If the GL version does not support non-power-of-two sizes,
2950 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2951 implementations support 3D texture images that are at least 16
2955 Specifies the depth of the texture image including the border if
2956 any. If the GL version does not support non-power-of-two sizes,
2957 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2958 implementations support 3D texture images that are at least 16
2962 Specifies the width of the border. Must be either 0 or 1.
2965 Specifies the number of unsigned bytes of image data starting at
2966 the address specified by DATA.
2969 Specifies a pointer to the compressed image data in memory.
2971 Texturing maps a portion of a specified texture image onto each
2972 graphical primitive for which texturing is enabled. To enable and
2973 disable three-dimensional texturing, call `glEnable' and `glDisable'
2974 with argument `GL_TEXTURE_3D'.
2976 `glCompressedTexImage3D' loads a previously defined, and retrieved,
2977 compressed three-dimensional texture image if TARGET is `GL_TEXTURE_3D'
2978 (see `glTexImage3D').
2980 If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
2981 of the texture image state is recalculated, checked for consistency, and
2982 checked against the implementation's capabilities. If the implementation
2983 cannot handle a texture of the requested texture size, it sets all of
2984 the image state to 0, but does not generate an error (see `glGetError').
2985 To query for an entire mipmap array, use an image array level greater
2988 INTERNALFORMAT must be an extension-specified compressed-texture format.
2989 When a texture is loaded with `glTexImage2D' using a generic compressed
2990 texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
2991 its extensions supporting compressed textures. In order to load the
2992 compressed texture image using `glCompressedTexImage3D', query the
2993 compressed texture image's size and format using
2994 `glGetTexLevelParameter'.
2996 If a non-zero named buffer object is bound to the
2997 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2998 image is specified, DATA is treated as a byte offset into the buffer
2999 object's data store.
3001 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
3002 compressed internal formats: `GL_COMPRESSED_ALPHA',
3003 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3004 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
3006 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3007 format, dimensions, and contents of the specified compressed image data.
3009 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3010 supported by the specific compressed internal format as specified in the
3011 specific texture compression extension.
3013 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3014 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3015 data store is currently mapped.
3017 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3018 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3019 unpacked from the buffer object such that the memory reads required
3020 would exceed the data store size.
3022 `GL_INVALID_OPERATION' is generated if `glCompressedTexImage3D' is
3023 executed between the execution of `glBegin' and the corresponding
3024 execution of `glEnd'.
3026 Undefined results, including abnormal program termination, are generated
3027 if DATA is not encoded in a manner consistent with the extension
3028 specification defining the internal compression format.")
3030 (define-gl-procedures
3031 ((glCompressedTexSubImage1D
3038 (data const-GLvoid-*)
3041 "Specify a one-dimensional texture subimage in a compressed format.
3044 Specifies the target texture. Must be `GL_TEXTURE_1D'.
3047 Specifies the level-of-detail number. Level 0 is the base image
3048 level. Level N is the Nth mipmap reduction image.
3051 Specifies a texel offset in the x direction within the texture
3055 Specifies the width of the texture subimage.
3058 Specifies the format of the compressed image data stored at address
3062 Specifies the number of unsigned bytes of image data starting at
3063 the address specified by DATA.
3066 Specifies a pointer to the compressed image data in memory.
3068 Texturing maps a portion of a specified texture image onto each
3069 graphical primitive for which texturing is enabled. To enable and
3070 disable one-dimensional texturing, call `glEnable' and `glDisable' with
3071 argument `GL_TEXTURE_1D'.
3073 `glCompressedTexSubImage1D' redefines a contiguous subregion of an
3074 existing one-dimensional texture image. The texels referenced by DATA
3075 replace the portion of the existing texture array with x indices XOFFSET
3076 and XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
3077 outside the range of the texture array as it was originally specified.
3078 It is not an error to specify a subtexture with width of 0, but such a
3079 specification has no effect.
3081 FORMAT must be an extension-specified compressed-texture format. The
3082 FORMAT of the compressed texture image is selected by the GL
3083 implementation that compressed it (see `glTexImage1D'), and should be
3084 queried at the time the texture was compressed with
3085 `glGetTexLevelParameter'.
3087 If a non-zero named buffer object is bound to the
3088 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3089 image is specified, DATA is treated as a byte offset into the buffer
3090 object's data store.
3092 `GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3093 compressed internal formats: `GL_COMPRESSED_ALPHA',
3094 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3095 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3096 `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3097 `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3098 `GL_COMPRESSED_SRGB_ALPHA'.
3100 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3101 format, dimensions, and contents of the specified compressed image data.
3103 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3104 supported by the specific compressed internal format as specified in the
3105 specific texture compression extension.
3107 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3108 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3109 data store is currently mapped.
3111 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3112 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3113 unpacked from the buffer object such that the memory reads required
3114 would exceed the data store size.
3116 `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage1D' is
3117 executed between the execution of `glBegin' and the corresponding
3118 execution of `glEnd'.
3120 Undefined results, including abnormal program termination, are generated
3121 if DATA is not encoded in a manner consistent with the extension
3122 specification defining the internal compression format.")
3124 (define-gl-procedures
3125 ((glCompressedTexSubImage2D
3134 (data const-GLvoid-*)
3137 "Specify a two-dimensional texture subimage in a compressed format.
3140 Specifies the target texture. Must be `GL_TEXTURE_2D',
3141 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
3142 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
3143 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
3144 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
3147 Specifies the level-of-detail number. Level 0 is the base image
3148 level. Level N is the Nth mipmap reduction image.
3151 Specifies a texel offset in the x direction within the texture
3155 Specifies a texel offset in the y direction within the texture
3159 Specifies the width of the texture subimage.
3162 Specifies the height of the texture subimage.
3165 Specifies the format of the compressed image data stored at address
3169 Specifies the number of unsigned bytes of image data starting at
3170 the address specified by DATA.
3173 Specifies a pointer to the compressed image data in memory.
3175 Texturing maps a portion of a specified texture image onto each
3176 graphical primitive for which texturing is enabled. To enable and
3177 disable two-dimensional texturing, call `glEnable' and `glDisable' with
3178 argument `GL_TEXTURE_2D'. To enable and disable texturing using
3179 cube-mapped texture, call `glEnable' and `glDisable' with argument
3180 `GL_TEXTURE_CUBE_MAP'.
3182 `glCompressedTexSubImage2D' redefines a contiguous subregion of an
3183 existing two-dimensional texture image. The texels referenced by DATA
3184 replace the portion of the existing texture array with x indices XOFFSET
3185 and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3186 inclusive. This region may not include any texels outside the range of
3187 the texture array as it was originally specified. It is not an error to
3188 specify a subtexture with width of 0, but such a specification has no
3191 FORMAT must be an extension-specified compressed-texture format. The
3192 FORMAT of the compressed texture image is selected by the GL
3193 implementation that compressed it (see `glTexImage2D') and should be
3194 queried at the time the texture was compressed with
3195 `glGetTexLevelParameter'.
3197 If a non-zero named buffer object is bound to the
3198 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3199 image is specified, DATA is treated as a byte offset into the buffer
3200 object's data store.
3202 `GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3203 compressed internal formats: `GL_COMPRESSED_ALPHA',
3204 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3205 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3206 `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3207 `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3208 `GL_COMPRESSED_SRGB_ALPHA'.
3210 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3211 format, dimensions, and contents of the specified compressed image data.
3213 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3214 supported by the specific compressed internal format as specified in the
3215 specific texture compression extension.
3217 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3218 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3219 data store is currently mapped.
3221 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3222 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3223 unpacked from the buffer object such that the memory reads required
3224 would exceed the data store size.
3226 `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage2D' is
3227 executed between the execution of `glBegin' and the corresponding
3228 execution of `glEnd'.
3230 Undefined results, including abnormal program termination, are generated
3231 if DATA is not encoded in a manner consistent with the extension
3232 specification defining the internal compression format.")
3234 (define-gl-procedures
3235 ((glCompressedTexSubImage3D
3246 (data const-GLvoid-*)
3249 "Specify a three-dimensional texture subimage in a compressed format.
3252 Specifies the target texture. Must be `GL_TEXTURE_3D'.
3255 Specifies the level-of-detail number. Level 0 is the base image
3256 level. Level N is the Nth mipmap reduction image.
3259 Specifies a texel offset in the x direction within the texture
3263 Specifies a texel offset in the y direction within the texture
3267 Specifies the width of the texture subimage.
3270 Specifies the height of the texture subimage.
3273 Specifies the depth of the texture subimage.
3276 Specifies the format of the compressed image data stored at address
3280 Specifies the number of unsigned bytes of image data starting at
3281 the address specified by DATA.
3284 Specifies a pointer to the compressed image data in memory.
3286 Texturing maps a portion of a specified texture image onto each
3287 graphical primitive for which texturing is enabled. To enable and
3288 disable three-dimensional texturing, call `glEnable' and `glDisable'
3289 with argument `GL_TEXTURE_3D'.
3291 `glCompressedTexSubImage3D' redefines a contiguous subregion of an
3292 existing three-dimensional texture image. The texels referenced by DATA
3293 replace the portion of the existing texture array with x indices XOFFSET
3294 and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3295 and the z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This region
3296 may not include any texels outside the range of the texture array as it
3297 was originally specified. It is not an error to specify a subtexture
3298 with width of 0, but such a specification has no effect.
3300 FORMAT must be an extension-specified compressed-texture format. The
3301 FORMAT of the compressed texture image is selected by the GL
3302 implementation that compressed it (see `glTexImage3D') and should be
3303 queried at the time the texture was compressed with
3304 `glGetTexLevelParameter'.
3306 If a non-zero named buffer object is bound to the
3307 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3308 image is specified, DATA is treated as a byte offset into the buffer
3309 object's data store.
3311 `GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3312 compressed internal formats: `GL_COMPRESSED_ALPHA',
3313 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3314 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3315 `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3316 `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3317 `GL_COMPRESSED_SRGB_ALPHA'.
3319 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3320 format, dimensions, and contents of the specified compressed image data.
3322 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3323 supported by the specific compressed internal format as specified in the
3324 specific texture compression extension.
3326 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3327 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3328 data store is currently mapped.
3330 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3331 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3332 unpacked from the buffer object such that the memory reads required
3333 would exceed the data store size.
3335 `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage3D' is
3336 executed between the execution of `glBegin' and the corresponding
3337 execution of `glEnd'.
3339 Undefined results, including abnormal program termination, are generated
3340 if DATA is not encoded in a manner consistent with the extension
3341 specification defining the internal compression format.")
3343 (define-gl-procedures
3344 ((glConvolutionFilter1D
3346 (internalformat GLenum)
3350 (data const-GLvoid-*)
3353 "Define a one-dimensional convolution filter.
3356 Must be `GL_CONVOLUTION_1D'.
3359 The internal format of the convolution filter kernel. The allowable
3360 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3361 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3362 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3363 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3364 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3365 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3366 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3367 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3368 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3369 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3370 `GL_RGBA12', or `GL_RGBA16'.
3373 The width of the pixel array referenced by DATA.
3376 The format of the pixel data in DATA. The allowable values are
3377 `GL_ALPHA', `GL_LUMINANCE', `GL_LUMINANCE_ALPHA', `GL_INTENSITY',
3378 `GL_RGB', and `GL_RGBA'.
3381 The type of the pixel data in DATA. Symbolic constants
3382 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3383 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3384 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3385 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3386 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3387 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3388 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3389 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3393 Pointer to a one-dimensional array of pixel data that is processed
3394 to build the convolution filter kernel.
3396 `glConvolutionFilter1D' builds a one-dimensional convolution filter
3397 kernel from an array of pixels.
3399 The pixel array specified by WIDTH, FORMAT, TYPE, and DATA is extracted
3400 from memory and processed just as if `glDrawPixels' were called, but
3401 processing stops after the final expansion to RGBA is completed.
3403 If a non-zero named buffer object is bound to the
3404 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3405 filter is specified, DATA is treated as a byte offset into the buffer
3406 object's data store.
3408 The R, G, B, and A components of each pixel are next scaled by the four
3409 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 1D
3410 `GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3411 are set by `glConvolutionParameter' using the `GL_CONVOLUTION_1D' target
3412 and the names `GL_CONVOLUTION_FILTER_SCALE' and
3413 `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3414 four values that are applied to red, green, blue, and alpha, in that
3415 order.) The R, G, B, and A values are not clamped to [0,1] at any time
3416 during this process.
3418 Each pixel is then converted to the internal format specified by
3419 INTERNALFORMAT. This conversion simply maps the component values of the
3420 pixel (R, G, B, and A) to the values included in the internal format
3421 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3427 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3435 `GL_LUMINANCE_ALPHA'
3447 The red, green, blue, alpha, luminance, and/or intensity components of
3448 the resulting pixels are stored in floating-point rather than integer
3449 format. They form a one-dimensional filter kernel image indexed with
3450 coordinate I such that I starts at 0 and increases from left to right.
3451 Kernel location I is derived from the Ith pixel, counting from 0.
3453 Note that after a convolution is performed, the resulting color
3454 components are also scaled by their corresponding
3455 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3456 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3457 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3458 set by `glPixelTransfer'.
3460 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
3462 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3465 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3468 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3471 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3472 than the maximum supported value. This value may be queried with
3473 `glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
3474 `GL_MAX_CONVOLUTION_WIDTH'.
3476 `GL_INVALID_OPERATION' is generated if FORMAT is one of
3477 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3478 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and TYPE is
3481 `GL_INVALID_OPERATION' is generated if FORMAT is one of
3482 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3483 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3484 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3485 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3486 TYPE is neither `GL_RGBA' nor `GL_BGRA'.
3488 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3489 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3490 data store is currently mapped.
3492 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3493 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3494 unpacked from the buffer object such that the memory reads required
3495 would exceed the data store size.
3497 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3498 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3499 divisible into the number of bytes needed to store in memory a datum
3502 `GL_INVALID_OPERATION' is generated if `glConvolutionFilter1D' is
3503 executed between the execution of `glBegin' and the corresponding
3504 execution of `glEnd'.")
3506 (define-gl-procedures
3507 ((glConvolutionFilter2D
3509 (internalformat GLenum)
3514 (data const-GLvoid-*)
3517 "Define a two-dimensional convolution filter.
3520 Must be `GL_CONVOLUTION_2D'.
3523 The internal format of the convolution filter kernel. The allowable
3524 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3525 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3526 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3527 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3528 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3529 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3530 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3531 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3532 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3533 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3534 `GL_RGBA12', or `GL_RGBA16'.
3537 The width of the pixel array referenced by DATA.
3540 The height of the pixel array referenced by DATA.
3543 The format of the pixel data in DATA. The allowable values are
3544 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
3545 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
3548 The type of the pixel data in DATA. Symbolic constants
3549 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3550 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3551 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3552 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3553 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3554 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3555 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3556 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3560 Pointer to a two-dimensional array of pixel data that is processed
3561 to build the convolution filter kernel.
3563 `glConvolutionFilter2D' builds a two-dimensional convolution filter
3564 kernel from an array of pixels.
3566 The pixel array specified by WIDTH, HEIGHT, FORMAT, TYPE, and DATA is
3567 extracted from memory and processed just as if `glDrawPixels' were
3568 called, but processing stops after the final expansion to RGBA is
3571 If a non-zero named buffer object is bound to the
3572 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3573 filter is specified, DATA is treated as a byte offset into the buffer
3574 object's data store.
3576 The R, G, B, and A components of each pixel are next scaled by the four
3577 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 2D
3578 `GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3579 are set by `glConvolutionParameter' using the `GL_CONVOLUTION_2D' target
3580 and the names `GL_CONVOLUTION_FILTER_SCALE' and
3581 `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3582 four values that are applied to red, green, blue, and alpha, in that
3583 order.) The R, G, B, and A values are not clamped to [0,1] at any time
3584 during this process.
3586 Each pixel is then converted to the internal format specified by
3587 INTERNALFORMAT. This conversion simply maps the component values of the
3588 pixel (R, G, B, and A) to the values included in the internal format
3589 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3595 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3603 `GL_LUMINANCE_ALPHA'
3615 The red, green, blue, alpha, luminance, and/or intensity components of
3616 the resulting pixels are stored in floating-point rather than integer
3617 format. They form a two-dimensional filter kernel image indexed with
3618 coordinates I and J such that I starts at zero and increases from left
3619 to right, and J starts at zero and increases from bottom to top. Kernel
3620 location I,J is derived from the Nth pixel, where N is I+J*WIDTH.
3622 Note that after a convolution is performed, the resulting color
3623 components are also scaled by their corresponding
3624 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3625 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3626 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3627 set by `glPixelTransfer'.
3629 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
3631 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3634 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3637 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3640 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3641 than the maximum supported value. This value may be queried with
3642 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3643 `GL_MAX_CONVOLUTION_WIDTH'.
3645 `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
3646 than the maximum supported value. This value may be queried with
3647 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3648 `GL_MAX_CONVOLUTION_HEIGHT'.
3650 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
3651 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3652 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
3655 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
3656 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3657 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3658 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3659 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3660 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
3662 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3663 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3664 data store is currently mapped.
3666 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3667 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3668 unpacked from the buffer object such that the memory reads required
3669 would exceed the data store size.
3671 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3672 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3673 divisible into the number of bytes needed to store in memory a datum
3676 `GL_INVALID_OPERATION' is generated if `glConvolutionFilter2D' is
3677 executed between the execution of `glBegin' and the corresponding
3678 execution of `glEnd'.")
3680 (define-gl-procedures
3681 ((glConvolutionParameterf
3687 (glConvolutionParameteri
3693 "Set convolution parameters.
3696 The target for the convolution parameter. Must be one of
3697 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D'.
3700 The parameter to be set. Must be `GL_CONVOLUTION_BORDER_MODE'.
3703 The parameter value. Must be one of `GL_REDUCE',
3704 `GL_CONSTANT_BORDER', `GL_REPLICATE_BORDER'.
3708 `glConvolutionParameter' sets the value of a convolution parameter.
3710 TARGET selects the convolution filter to be affected:
3711 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D' for the
3712 1D, 2D, or separable 2D filter, respectively.
3714 PNAME selects the parameter to be changed. `GL_CONVOLUTION_FILTER_SCALE'
3715 and `GL_CONVOLUTION_FILTER_BIAS' affect the definition of the
3716 convolution filter kernel; see `glConvolutionFilter1D',
3717 `glConvolutionFilter2D', and `glSeparableFilter2D' for details. In these
3718 cases, PARAMSv is an array of four values to be applied to red, green,
3719 blue, and alpha values, respectively. The initial value for
3720 `GL_CONVOLUTION_FILTER_SCALE' is (1, 1, 1, 1), and the initial value for
3721 `GL_CONVOLUTION_FILTER_BIAS' is (0, 0, 0, 0).
3723 A PNAME value of `GL_CONVOLUTION_BORDER_MODE' controls the convolution
3724 border mode. The accepted modes are:
3727 The image resulting from convolution is smaller than the source
3728 image. If the filter width is WF and height is HF , and the source
3729 image width is WS and height is HS , then the convolved image width
3730 will be WS-WF+1 and height will be HS-HF+1 . (If this reduction
3731 would generate an image with zero or negative width and/or height,
3732 the output is simply null, with no error generated.) The
3733 coordinates of the image resulting from convolution are zero
3734 through WS-WF in width and zero through HS-HF in height.
3736 `GL_CONSTANT_BORDER'
3737 The image resulting from convolution is the same size as the source
3738 image, and processed as if the source image were surrounded by
3739 pixels with their color specified by the
3740 `GL_CONVOLUTION_BORDER_COLOR'.
3742 `GL_REPLICATE_BORDER'
3743 The image resulting from convolution is the same size as the source
3744 image, and processed as if the outermost pixel on the border of the
3745 source image were replicated.
3747 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
3750 `GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
3753 `GL_INVALID_ENUM' is generated if PNAME is `GL_CONVOLUTION_BORDER_MODE'
3754 and PARAMS is not one of `GL_REDUCE', `GL_CONSTANT_BORDER', or
3755 `GL_REPLICATE_BORDER'.
3757 `GL_INVALID_OPERATION' is generated if `glConvolutionParameter' is
3758 executed between the execution of `glBegin' and the corresponding
3759 execution of `glEnd'.")
3761 (define-gl-procedures
3762 ((glCopyColorSubTable
3770 "Respecify a portion of a color table.
3773 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
3774 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3777 The starting index of the portion of the color table to be
3783 The window coordinates of the left corner of the row of pixels to
3787 The number of table entries to replace.
3789 `glCopyColorSubTable' is used to respecify a contiguous portion of a
3790 color table previously defined using `glColorTable'. The pixels copied
3791 from the framebuffer replace the portion of the existing table from
3792 indices START to START+X-1 , inclusive. This region may not include any
3793 entries outside the range of the color table, as was originally
3794 specified. It is not an error to specify a subtexture with width of 0,
3795 but such a specification has no effect.
3797 `GL_INVALID_VALUE' is generated if TARGET is not a previously defined
3800 `GL_INVALID_VALUE' is generated if TARGET is not one of the allowable
3803 `GL_INVALID_VALUE' is generated if START+X>WIDTH .
3805 `GL_INVALID_OPERATION' is generated if `glCopyColorSubTable' is executed
3806 between the execution of `glBegin' and the corresponding execution of
3809 (define-gl-procedures
3812 (internalformat GLenum)
3818 "Copy pixels into a color table.
3821 The color table target. Must be `GL_COLOR_TABLE',
3822 `GL_POST_CONVOLUTION_COLOR_TABLE', or
3823 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3826 The internal storage format of the texture image. Must be one of
3827 the following symbolic constants: `GL_ALPHA', `GL_ALPHA4',
3828 `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', `GL_LUMINANCE',
3829 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
3830 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
3831 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
3832 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
3833 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
3834 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
3835 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
3836 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
3837 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
3840 The x coordinate of the lower-left corner of the pixel rectangle to
3841 be transferred to the color table.
3844 The y coordinate of the lower-left corner of the pixel rectangle to
3845 be transferred to the color table.
3848 The width of the pixel rectangle.
3850 `glCopyColorTable' loads a color table with pixels from the current
3851 `GL_READ_BUFFER' (rather than from main memory, as is the case for
3854 The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y)
3855 having width WIDTH and height 1 is loaded into the color table. If any
3856 pixels within this region are outside the window that is associated with
3857 the GL context, the values obtained for those pixels are undefined.
3859 The pixels in the rectangle are processed just as if `glReadPixels' were
3860 called, with INTERNALFORMAT set to RGBA, but processing stops after the
3861 final conversion to RGBA.
3863 The four scale parameters and the four bias parameters that are defined
3864 for the table are then used to scale and bias the R, G, B, and A
3865 components of each pixel. The scale and bias parameters are set by
3866 calling `glColorTableParameter'.
3868 Next, the R, G, B, and A values are clamped to the range [0,1] . Each
3869 pixel is then converted to the internal format specified by
3870 INTERNALFORMAT. This conversion simply maps the component values of the
3871 pixel (R, G, B, and A) to the values included in the internal format
3872 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3878 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3886 `GL_LUMINANCE_ALPHA'
3898 Finally, the red, green, blue, alpha, luminance, and/or intensity
3899 components of the resulting pixels are stored in the color table. They
3900 form a one-dimensional table with indices in the range [0,WIDTH-1] .
3904 `GL_INVALID_ENUM' is generated when TARGET is not one of the allowable
3907 `GL_INVALID_VALUE' is generated if WIDTH is less than zero.
3909 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not one of the
3912 `GL_TABLE_TOO_LARGE' is generated if the requested color table is too
3913 large to be supported by the implementation.
3915 `GL_INVALID_OPERATION' is generated if `glCopyColorTable' is executed
3916 between the execution of `glBegin' and the corresponding execution of
3919 (define-gl-procedures
3920 ((glCopyConvolutionFilter1D
3922 (internalformat GLenum)
3928 "Copy pixels into a one-dimensional convolution filter.
3931 Must be `GL_CONVOLUTION_1D'.
3934 The internal format of the convolution filter kernel. The allowable
3935 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3936 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3937 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3938 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3939 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3940 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3941 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3942 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3943 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3944 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3945 `GL_RGBA12', or `GL_RGBA16'.
3950 The window space coordinates of the lower-left coordinate of the
3951 pixel array to copy.
3954 The width of the pixel array to copy.
3956 `glCopyConvolutionFilter1D' defines a one-dimensional convolution filter
3957 kernel with pixels from the current `GL_READ_BUFFER' (rather than from
3958 main memory, as is the case for `glConvolutionFilter1D').
3960 The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
3961 width WIDTH and height 1 is used to define the convolution filter. If
3962 any pixels within this region are outside the window that is associated
3963 with the GL context, the values obtained for those pixels are undefined.
3965 The pixels in the rectangle are processed exactly as if `glReadPixels'
3966 had been called with FORMAT set to RGBA, but the process stops just
3967 before final conversion. The R, G, B, and A components of each pixel are
3968 next scaled by the four 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and
3969 biased by the four 1D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
3970 scale and bias parameters are set by `glConvolutionParameter' using the
3971 `GL_CONVOLUTION_1D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
3972 and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
3973 of four values that are applied to red, green, blue, and alpha, in that
3974 order.) The R, G, B, and A values are not clamped to [0,1] at any time
3975 during this process.
3977 Each pixel is then converted to the internal format specified by
3978 INTERNALFORMAT. This conversion simply maps the component values of the
3979 pixel (R, G, B, and A) to the values included in the internal format
3980 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3986 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3994 `GL_LUMINANCE_ALPHA'
4006 The red, green, blue, alpha, luminance, and/or intensity components of
4007 the resulting pixels are stored in floating-point rather than integer
4010 Pixel ordering is such that lower x screen coordinates correspond to
4011 lower I filter image coordinates.
4013 Note that after a convolution is performed, the resulting color
4014 components are also scaled by their corresponding
4015 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4016 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4017 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4018 set by `glPixelTransfer'.
4020 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
4022 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4025 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4026 than the maximum supported value. This value may be queried with
4027 `glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
4028 `GL_MAX_CONVOLUTION_WIDTH'.
4030 `GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter1D' is
4031 executed between the execution of `glBegin' and the corresponding
4032 execution of `glEnd'.")
4034 (define-gl-procedures
4035 ((glCopyConvolutionFilter2D
4037 (internalformat GLenum)
4044 "Copy pixels into a two-dimensional convolution filter.
4047 Must be `GL_CONVOLUTION_2D'.
4050 The internal format of the convolution filter kernel. The allowable
4051 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
4052 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
4053 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
4054 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
4055 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
4056 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
4057 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
4058 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
4059 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
4060 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
4061 `GL_RGBA12', or `GL_RGBA16'.
4066 The window space coordinates of the lower-left coordinate of the
4067 pixel array to copy.
4070 The width of the pixel array to copy.
4073 The height of the pixel array to copy.
4075 `glCopyConvolutionFilter2D' defines a two-dimensional convolution filter
4076 kernel with pixels from the current `GL_READ_BUFFER' (rather than from
4077 main memory, as is the case for `glConvolutionFilter2D').
4079 The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
4080 width WIDTH and height HEIGHT is used to define the convolution filter.
4081 If any pixels within this region are outside the window that is
4082 associated with the GL context, the values obtained for those pixels are
4085 The pixels in the rectangle are processed exactly as if `glReadPixels'
4086 had been called with FORMAT set to RGBA, but the process stops just
4087 before final conversion. The R, G, B, and A components of each pixel are
4088 next scaled by the four 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and
4089 biased by the four 2D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
4090 scale and bias parameters are set by `glConvolutionParameter' using the
4091 `GL_CONVOLUTION_2D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
4092 and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
4093 of four values that are applied to red, green, blue, and alpha, in that
4094 order.) The R, G, B, and A values are not clamped to [0,1] at any time
4095 during this process.
4097 Each pixel is then converted to the internal format specified by
4098 INTERNALFORMAT. This conversion simply maps the component values of the
4099 pixel (R, G, B, and A) to the values included in the internal format
4100 (red, green, blue, alpha, luminance, and intensity). The mapping is as
4106 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4114 `GL_LUMINANCE_ALPHA'
4126 The red, green, blue, alpha, luminance, and/or intensity components of
4127 the resulting pixels are stored in floating-point rather than integer
4130 Pixel ordering is such that lower x screen coordinates correspond to
4131 lower I filter image coordinates, and lower y screen coordinates
4132 correspond to lower J filter image coordinates.
4134 Note that after a convolution is performed, the resulting color
4135 components are also scaled by their corresponding
4136 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4137 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4138 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4139 set by `glPixelTransfer'.
4141 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
4143 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4146 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4147 than the maximum supported value. This value may be queried with
4148 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4149 `GL_MAX_CONVOLUTION_WIDTH'.
4151 `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
4152 than the maximum supported value. This value may be queried with
4153 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4154 `GL_MAX_CONVOLUTION_HEIGHT'.
4156 `GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter2D' is
4157 executed between the execution of `glBegin' and the corresponding
4158 execution of `glEnd'.")
4160 (define-gl-procedures
4169 "Copy pixels in the frame buffer.
4174 Specify the window coordinates of the lower left corner of the
4175 rectangular region of pixels to be copied.
4180 Specify the dimensions of the rectangular region of pixels to be
4181 copied. Both must be nonnegative.
4184 Specifies whether color values, depth values, or stencil values are
4185 to be copied. Symbolic constants `GL_COLOR', `GL_DEPTH', and
4186 `GL_STENCIL' are accepted.
4188 `glCopyPixels' copies a screen-aligned rectangle of pixels from the
4189 specified frame buffer location to a region relative to the current
4190 raster position. Its operation is well defined only if the entire pixel
4191 source region is within the exposed portion of the window. Results of
4192 copies from outside the window, or from regions of the window that are
4193 not exposed, are hardware dependent and undefined.
4195 X and Y specify the window coordinates of the lower left corner of the
4196 rectangular region to be copied. WIDTH and HEIGHT specify the dimensions
4197 of the rectangular region to be copied. Both WIDTH and HEIGHT must not
4200 Several parameters control the processing of the pixel data while it is
4201 being copied. These parameters are set with three commands:
4202 `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This reference page
4203 describes the effects on `glCopyPixels' of most, but not all, of the
4204 parameters specified by these three commands.
4206 `glCopyPixels' copies values from each pixel with the lower left-hand
4207 corner at (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said
4208 to be the I th pixel in the J th row. Pixels are copied in row order
4209 from the lowest to the highest row, left to right in each row.
4211 TYPE specifies whether color, depth, or stencil data is to be copied.
4212 The details of the transfer for each data type are as follows:
4215 Indices or RGBA colors are read from the buffer currently specified
4216 as the read source buffer (see `glReadBuffer'). If the GL is in
4217 color index mode, each index that is read from this buffer is
4218 converted to a fixed-point format with an unspecified number of
4219 bits to the right of the binary point. Each index is then shifted
4220 left by `GL_INDEX_SHIFT' bits, and added to `GL_INDEX_OFFSET'. If
4221 `GL_INDEX_SHIFT' is negative, the shift is to the right. In either
4222 case, zero bits fill otherwise unspecified bit locations in the
4223 result. If `GL_MAP_COLOR' is true, the index is replaced with the
4224 value that it references in lookup table `GL_PIXEL_MAP_I_TO_I'.
4225 Whether the lookup replacement of the index is done or not, the
4226 integer part of the index is then ANDed with 2^B-1 , where B is the
4227 number of bits in a color index buffer.
4229 If the GL is in RGBA mode, the red, green, blue, and alpha
4230 components of each pixel that is read are converted to an internal
4231 floating-point format with unspecified precision. The conversion
4232 maps the largest representable component value to 1.0, and
4233 component value 0 to 0.0. The resulting floating-point color values
4234 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
4235 C is RED, GREEN, BLUE, and ALPHA for the respective color
4236 components. The results are clamped to the range [0,1]. If
4237 `GL_MAP_COLOR' is true, each color component is scaled by the size
4238 of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the value
4239 that it references in that table. C is R, G, B, or A.
4241 If the `ARB_imaging' extension is supported, the color values may
4242 be additionally processed by color-table lookups, color-matrix
4243 transformations, and convolution filters.
4245 The GL then converts the resulting indices or RGBA colors to
4246 fragments by attaching the current raster position Z coordinate and
4247 texture coordinates to each pixel, then assigning window
4248 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4249 position, and the pixel was the I th pixel in the J th row. These
4250 pixel fragments are then treated just like the fragments generated
4251 by rasterizing points, lines, or polygons. Texture mapping, fog,
4252 and all the fragment operations are applied before the fragments
4253 are written to the frame buffer.
4256 Depth values are read from the depth buffer and converted directly
4257 to an internal floating-point format with unspecified precision.
4258 The resulting floating-point depth value is then multiplied by
4259 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
4260 clamped to the range [0,1].
4262 The GL then converts the resulting depth components to fragments by
4263 attaching the current raster position color or color index and
4264 texture coordinates to each pixel, then assigning window
4265 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4266 position, and the pixel was the I th pixel in the J th row. These
4267 pixel fragments are then treated just like the fragments generated
4268 by rasterizing points, lines, or polygons. Texture mapping, fog,
4269 and all the fragment operations are applied before the fragments
4270 are written to the frame buffer.
4273 Stencil indices are read from the stencil buffer and converted to
4274 an internal fixed-point format with an unspecified number of bits
4275 to the right of the binary point. Each fixed-point index is then
4276 shifted left by `GL_INDEX_SHIFT' bits, and added to
4277 `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is negative, the shift is to
4278 the right. In either case, zero bits fill otherwise unspecified bit
4279 locations in the result. If `GL_MAP_STENCIL' is true, the index is
4280 replaced with the value that it references in lookup table
4281 `GL_PIXEL_MAP_S_TO_S'. Whether the lookup replacement of the index
4282 is done or not, the integer part of the index is then ANDed with
4283 2^B-1 , where B is the number of bits in the stencil buffer. The
4284 resulting stencil indices are then written to the stencil buffer
4285 such that the index read from the I th location of the J th row is
4286 written to location (X_R+I,Y_R+J) , where (X_R,Y_R) is the current
4287 raster position. Only the pixel ownership test, the scissor test,
4288 and the stencil writemask affect these write operations.
4290 The rasterization described thus far assumes pixel zoom factors of 1.0.
4291 If `glPixelZoom' is used to change the X and Y pixel zoom factors,
4292 pixels are converted to fragments as follows. If (X_R,Y_R) is the
4293 current raster position, and a given pixel is in the I th location in
4294 the J th row of the source pixel rectangle, then fragments are generated
4295 for pixels whose centers are in the rectangle with corners at
4297 (X_R+ZOOM_X,\u2062I,Y_R+ZOOM_Y,\u2062J)
4301 (X_R+ZOOM_X,\u2061(I+1,),Y_R+ZOOM_Y,\u2061(J+1,))
4303 where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
4306 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
4308 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
4310 `GL_INVALID_OPERATION' is generated if TYPE is `GL_DEPTH' and there is
4313 `GL_INVALID_OPERATION' is generated if TYPE is `GL_STENCIL' and there is
4316 `GL_INVALID_OPERATION' is generated if `glCopyPixels' is executed
4317 between the execution of `glBegin' and the corresponding execution of
4320 (define-gl-procedures
4324 (internalformat GLenum)
4331 "Copy pixels into a 1D texture image.
4334 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4337 Specifies the level-of-detail number. Level 0 is the base image
4338 level. Level N is the Nth mipmap reduction image.
4341 Specifies the internal format of the texture. Must be one of the
4342 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4343 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4344 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4345 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4346 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4347 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4348 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4349 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4350 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4351 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4352 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4353 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4354 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4355 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4356 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4357 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4358 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4364 Specify the window coordinates of the left corner of the row of
4365 pixels to be copied.
4368 Specifies the width of the texture image. Must be 0 or
4369 2^N+2\u2061(BORDER,) for some integer N . The height of the texture
4373 Specifies the width of the border. Must be either 0 or 1.
4375 `glCopyTexImage1D' defines a one-dimensional texture image with pixels
4376 from the current `GL_READ_BUFFER'.
4378 The screen-aligned pixel row with left corner at (X,Y) and with a length
4379 of WIDTH+2\u2061(BORDER,) defines the texture array at the mipmap level
4380 specified by LEVEL. INTERNALFORMAT specifies the internal format of the
4383 The pixels in the row are processed exactly as if `glCopyPixels' had
4384 been called, but the process stops just before final conversion. At this
4385 point all pixel component values are clamped to the range [0,1] and then
4386 converted to the texture's internal format for storage in the texel
4389 Pixel ordering is such that lower X screen coordinates correspond to
4390 lower texture coordinates.
4392 If any of the pixels within the specified row of the current
4393 `GL_READ_BUFFER' are outside the window associated with the current
4394 rendering context, then the values obtained for those pixels are
4397 `glCopyTexImage1D' defines a one-dimensional texture image with pixels
4398 from the current `GL_READ_BUFFER'.
4400 When INTERNALFORMAT is one of the sRGB types, the GL does not
4401 automatically convert the source pixels to the sRGB color space. In this
4402 case, the `glPixelMap' function can be used to accomplish the
4405 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
4408 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4410 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4411 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4413 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an allowable
4416 `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
4417 2 + `GL_MAX_TEXTURE_SIZE'.
4419 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4420 supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
4421 some integer value of N.
4423 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4425 `GL_INVALID_OPERATION' is generated if `glCopyTexImage1D' is executed
4426 between the execution of `glBegin' and the corresponding execution of
4429 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4430 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4431 `GL_DEPTH_COMPONENT32' and there is no depth buffer.")
4433 (define-gl-procedures
4437 (internalformat GLenum)
4445 "Copy pixels into a 2D texture image.
4448 Specifies the target texture. Must be `GL_TEXTURE_2D',
4449 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4450 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4451 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4452 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4455 Specifies the level-of-detail number. Level 0 is the base image
4456 level. Level N is the Nth mipmap reduction image.
4459 Specifies the internal format of the texture. Must be one of the
4460 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4461 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4462 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4463 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4464 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4465 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4466 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4467 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4468 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4469 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4470 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4471 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4472 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4473 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4474 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4475 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4476 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4482 Specify the window coordinates of the lower left corner of the
4483 rectangular region of pixels to be copied.
4486 Specifies the width of the texture image. Must be 0 or
4487 2^N+2\u2061(BORDER,) for some integer N .
4490 Specifies the height of the texture image. Must be 0 or
4491 2^M+2\u2061(BORDER,) for some integer M .
4494 Specifies the width of the border. Must be either 0 or 1.
4496 `glCopyTexImage2D' defines a two-dimensional texture image, or cube-map
4497 texture image with pixels from the current `GL_READ_BUFFER'.
4499 The screen-aligned pixel rectangle with lower left corner at (X, Y) and
4500 with a width of WIDTH+2\u2061(BORDER,) and a height of HEIGHT+2\u2061(BORDER,)
4501 defines the texture array at the mipmap level specified by LEVEL.
4502 INTERNALFORMAT specifies the internal format of the texture array.
4504 The pixels in the rectangle are processed exactly as if `glCopyPixels'
4505 had been called, but the process stops just before final conversion. At
4506 this point all pixel component values are clamped to the range [0,1] and
4507 then converted to the texture's internal format for storage in the texel
4510 Pixel ordering is such that lower X and Y screen coordinates correspond
4511 to lower S and T texture coordinates.
4513 If any of the pixels within the specified rectangle of the current
4514 `GL_READ_BUFFER' are outside the window associated with the current
4515 rendering context, then the values obtained for those pixels are
4518 When INTERNALFORMAT is one of the sRGB types, the GL does not
4519 automatically convert the source pixels to the sRGB color space. In this
4520 case, the `glPixelMap' function can be used to accomplish the
4523 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4524 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4525 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4526 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4528 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4530 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4531 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4533 `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
4534 2 + `GL_MAX_TEXTURE_SIZE'.
4536 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4537 supported and the WIDTH or DEPTH cannot be represented as
4538 2^K+2\u2061(BORDER,) for some integer K .
4540 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4542 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an accepted
4545 `GL_INVALID_OPERATION' is generated if `glCopyTexImage2D' is executed
4546 between the execution of `glBegin' and the corresponding execution of
4549 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4550 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4551 `GL_DEPTH_COMPONENT32' and there is no depth buffer.")
4553 (define-gl-procedures
4554 ((glCopyTexSubImage1D
4563 "Copy a one-dimensional texture subimage.
4566 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4569 Specifies the level-of-detail number. Level 0 is the base image
4570 level. Level N is the Nth mipmap reduction image.
4573 Specifies the texel offset within the texture array.
4578 Specify the window coordinates of the left corner of the row of
4579 pixels to be copied.
4582 Specifies the width of the texture subimage.
4584 `glCopyTexSubImage1D' replaces a portion of a one-dimensional texture
4585 image with pixels from the current `GL_READ_BUFFER' (rather than from
4586 main memory, as is the case for `glTexSubImage1D').
4588 The screen-aligned pixel row with left corner at (X,\\ Y), and with
4589 length WIDTH replaces the portion of the texture array with x indices
4590 XOFFSET through XOFFSET+WIDTH-1 , inclusive. The destination in the
4591 texture array may not include any texels outside the texture array as it
4592 was originally specified.
4594 The pixels in the row are processed exactly as if `glCopyPixels' had
4595 been called, but the process stops just before final conversion. At this
4596 point, all pixel component values are clamped to the range [0,1] and
4597 then converted to the texture's internal format for storage in the texel
4600 It is not an error to specify a subtexture with zero width, but such a
4601 specification has no effect. If any of the pixels within the specified
4602 row of the current `GL_READ_BUFFER' are outside the read window
4603 associated with the current rendering context, then the values obtained
4604 for those pixels are undefined.
4606 No change is made to the INTERNALFORMAT, WIDTH, or BORDER parameters of
4607 the specified texture array or to texel values outside the specified
4610 `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_1D'.
4612 `GL_INVALID_OPERATION' is generated if the texture array has not been
4613 defined by a previous `glTexImage1D' or `glCopyTexImage1D' operation.
4615 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4617 `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4618 the returned value of `GL_MAX_TEXTURE_SIZE'.
4620 `GL_INVALID_VALUE' is generated if XOFFSET<-B , or
4621 (XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH' and B is the
4622 `GL_TEXTURE_BORDER' of the texture image being modified. Note that W
4623 includes twice the border width.")
4625 (define-gl-procedures
4626 ((glCopyTexSubImage2D
4637 "Copy a two-dimensional texture subimage.
4640 Specifies the target texture. Must be `GL_TEXTURE_2D',
4641 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4642 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4643 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4644 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4647 Specifies the level-of-detail number. Level 0 is the base image
4648 level. Level N is the Nth mipmap reduction image.
4651 Specifies a texel offset in the x direction within the texture
4655 Specifies a texel offset in the y direction within the texture
4661 Specify the window coordinates of the lower left corner of the
4662 rectangular region of pixels to be copied.
4665 Specifies the width of the texture subimage.
4668 Specifies the height of the texture subimage.
4670 `glCopyTexSubImage2D' replaces a rectangular portion of a
4671 two-dimensional texture image or cube-map texture image with pixels from
4672 the current `GL_READ_BUFFER' (rather than from main memory, as is the
4673 case for `glTexSubImage2D').
4675 The screen-aligned pixel rectangle with lower left corner at (X,Y) and
4676 with width WIDTH and height HEIGHT replaces the portion of the texture
4677 array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4678 indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at the mipmap
4679 level specified by LEVEL.
4681 The pixels in the rectangle are processed exactly as if `glCopyPixels'
4682 had been called, but the process stops just before final conversion. At
4683 this point, all pixel component values are clamped to the range [0,1]
4684 and then converted to the texture's internal format for storage in the
4687 The destination rectangle in the texture array may not include any
4688 texels outside the texture array as it was originally specified. It is
4689 not an error to specify a subtexture with zero width or height, but such
4690 a specification has no effect.
4692 If any of the pixels within the specified rectangle of the current
4693 `GL_READ_BUFFER' are outside the read window associated with the current
4694 rendering context, then the values obtained for those pixels are
4697 No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, or BORDER
4698 parameters of the specified texture array or to texel values outside the
4699 specified subregion.
4701 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4702 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4703 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4704 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4706 `GL_INVALID_OPERATION' is generated if the texture array has not been
4707 defined by a previous `glTexImage2D' or `glCopyTexImage2D' operation.
4709 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4711 `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4712 the returned value of `GL_MAX_TEXTURE_SIZE'.
4714 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4715 , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
4716 `GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the
4717 `GL_TEXTURE_BORDER' of the texture image being modified. Note that W and
4718 H include twice the border width.
4720 `GL_INVALID_OPERATION' is generated if `glCopyTexSubImage2D' is executed
4721 between the execution of `glBegin' and the corresponding execution of
4724 (define-gl-procedures
4725 ((glCopyTexSubImage3D
4737 "Copy a three-dimensional texture subimage.
4740 Specifies the target texture. Must be `GL_TEXTURE_3D'
4743 Specifies the level-of-detail number. Level 0 is the base image
4744 level. Level N is the Nth mipmap reduction image.
4747 Specifies a texel offset in the x direction within the texture
4751 Specifies a texel offset in the y direction within the texture
4755 Specifies a texel offset in the z direction within the texture
4761 Specify the window coordinates of the lower left corner of the
4762 rectangular region of pixels to be copied.
4765 Specifies the width of the texture subimage.
4768 Specifies the height of the texture subimage.
4770 `glCopyTexSubImage3D' replaces a rectangular portion of a
4771 three-dimensional texture image with pixels from the current
4772 `GL_READ_BUFFER' (rather than from main memory, as is the case for
4775 The screen-aligned pixel rectangle with lower left corner at (X,\\ Y) and
4776 with width WIDTH and height HEIGHT replaces the portion of the texture
4777 array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4778 indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at z index ZOFFSET
4779 and at the mipmap level specified by LEVEL.
4781 The pixels in the rectangle are processed exactly as if `glCopyPixels'
4782 had been called, but the process stops just before final conversion. At
4783 this point, all pixel component values are clamped to the range [0,1]
4784 and then converted to the texture's internal format for storage in the
4787 The destination rectangle in the texture array may not include any
4788 texels outside the texture array as it was originally specified. It is
4789 not an error to specify a subtexture with zero width or height, but such
4790 a specification has no effect.
4792 If any of the pixels within the specified rectangle of the current
4793 `GL_READ_BUFFER' are outside the read window associated with the current
4794 rendering context, then the values obtained for those pixels are
4797 No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, DEPTH, or BORDER
4798 parameters of the specified texture array or to texel values outside the
4799 specified subregion.
4801 `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
4803 `GL_INVALID_OPERATION' is generated if the texture array has not been
4804 defined by a previous `glTexImage3D' operation.
4806 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4808 `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4809 the returned value of `GL_MAX_3D_TEXTURE_SIZE'.
4811 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4812 , YOFFSET<-B , (YOFFSET+HEIGHT,)>(H-B,) , ZOFFSET<-B , or
4813 (ZOFFSET+1,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
4814 `GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH', and B is the
4815 `GL_TEXTURE_BORDER' of the texture image being modified. Note that W , H
4816 , and D include twice the border width.
4818 `GL_INVALID_OPERATION' is generated if `glCopyTexSubImage3D' is executed
4819 between the execution of `glBegin' and the corresponding execution of
4822 (define-gl-procedures
4823 ((glCreateProgram -> GLuint))
4824 "Creates a program object.
4826 `glCreateProgram' creates an empty program object and returns a non-zero
4827 value by which it can be referenced. A program object is an object to
4828 which shader objects can be attached. This provides a mechanism to
4829 specify the shader objects that will be linked to create a program. It
4830 also provides a means for checking the compatibility of the shaders that
4831 will be used to create a program (for instance, checking the
4832 compatibility between a vertex shader and a fragment shader). When no
4833 longer needed as part of a program object, shader objects can be
4836 One or more executables are created in a program object by successfully
4837 attaching shader objects to it with `glAttachShader', successfully
4838 compiling the shader objects with `glCompileShader', and successfully
4839 linking the program object with `glLinkProgram'. These executables are
4840 made part of current state when `glUseProgram' is called. Program
4841 objects can be deleted by calling `glDeleteProgram'. The memory
4842 associated with the program object will be deleted when it is no longer
4843 part of current rendering state for any context.
4845 This function returns 0 if an error occurs creating the program object.
4847 `GL_INVALID_OPERATION' is generated if `glCreateProgram' is executed
4848 between the execution of `glBegin' and the corresponding execution of
4851 (define-gl-procedures
4852 ((glCreateShader (shaderType GLenum) -> GLuint))
4853 "Creates a shader object.
4856 Specifies the type of shader to be created. Must be either
4857 `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER'.
4859 `glCreateShader' creates an empty shader object and returns a non-zero
4860 value by which it can be referenced. A shader object is used to maintain
4861 the source code strings that define a shader. SHADERTYPE indicates the
4862 type of shader to be created. Two types of shaders are supported. A
4863 shader of type `GL_VERTEX_SHADER' is a shader that is intended to run on
4864 the programmable vertex processor and replace the fixed functionality
4865 vertex processing in OpenGL. A shader of type `GL_FRAGMENT_SHADER' is a
4866 shader that is intended to run on the programmable fragment processor
4867 and replace the fixed functionality fragment processing in OpenGL.
4869 When created, a shader object's `GL_SHADER_TYPE' parameter is set to
4870 either `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER', depending on the
4871 value of SHADERTYPE.
4873 This function returns 0 if an error occurs creating the shader object.
4875 `GL_INVALID_ENUM' is generated if SHADERTYPE is not an accepted value.
4877 `GL_INVALID_OPERATION' is generated if `glCreateShader' is executed
4878 between the execution of `glBegin' and the corresponding execution of
4881 (define-gl-procedures
4882 ((glCullFace (mode GLenum) -> void))
4883 "Specify whether front- or back-facing facets can be culled.
4886 Specifies whether front- or back-facing facets are candidates for
4887 culling. Symbolic constants `GL_FRONT', `GL_BACK', and
4888 `GL_FRONT_AND_BACK' are accepted. The initial value is `GL_BACK'.
4890 `glCullFace' specifies whether front- or back-facing facets are culled
4891 (as specified by MODE) when facet culling is enabled. Facet culling is
4892 initially disabled. To enable and disable facet culling, call the
4893 `glEnable' and `glDisable' commands with the argument `GL_CULL_FACE'.
4894 Facets include triangles, quadrilaterals, polygons, and rectangles.
4896 `glFrontFace' specifies which of the clockwise and counterclockwise
4897 facets are front-facing and back-facing. See `glFrontFace'.
4899 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
4901 `GL_INVALID_OPERATION' is generated if `glCullFace' is executed between
4902 the execution of `glBegin' and the corresponding execution of `glEnd'.")
4904 (define-gl-procedures
4907 (buffers const-GLuint-*)
4910 "Delete named buffer objects.
4913 Specifies the number of buffer objects to be deleted.
4916 Specifies an array of buffer objects to be deleted.
4918 `glDeleteBuffers' deletes N buffer objects named by the elements of the
4919 array BUFFERS. After a buffer object is deleted, it has no contents, and
4920 its name is free for reuse (for example by `glGenBuffers'). If a buffer
4921 object that is currently bound is deleted, the binding reverts to 0 (the
4922 absence of any buffer object, which reverts to client memory usage).
4924 `glDeleteBuffers' silently ignores 0's and names that do not correspond
4925 to existing buffer objects.
4927 `GL_INVALID_VALUE' is generated if N is negative.
4929 `GL_INVALID_OPERATION' is generated if `glDeleteBuffers' is executed
4930 between the execution of `glBegin' and the corresponding execution of
4933 (define-gl-procedures
4939 "Delete a contiguous group of display lists.
4942 Specifies the integer name of the first display list to delete.
4945 Specifies the number of display lists to delete.
4947 `glDeleteLists' causes a contiguous group of display lists to be
4948 deleted. LIST is the name of the first display list to be deleted, and
4949 RANGE is the number of display lists to delete. All display lists D with
4950 LIST<=D<=LIST+RANGE-1 are deleted.
4952 All storage locations allocated to the specified display lists are
4953 freed, and the names are available for reuse at a later time. Names
4954 within the range that do not have an associated display list are
4955 ignored. If RANGE is 0, nothing happens.
4957 `GL_INVALID_VALUE' is generated if RANGE is negative.
4959 `GL_INVALID_OPERATION' is generated if `glDeleteLists' is executed
4960 between the execution of `glBegin' and the corresponding execution of
4963 (define-gl-procedures
4964 ((glDeleteProgram (program GLuint) -> void))
4965 "Deletes a program object.
4968 Specifies the program object to be deleted.
4970 `glDeleteProgram' frees the memory and invalidates the name associated
4971 with the program object specified by PROGRAM. This command effectively
4972 undoes the effects of a call to `glCreateProgram'.
4974 If a program object is in use as part of current rendering state, it
4975 will be flagged for deletion, but it will not be deleted until it is no
4976 longer part of current state for any rendering context. If a program
4977 object to be deleted has shader objects attached to it, those shader
4978 objects will be automatically detached but not deleted unless they have
4979 already been flagged for deletion by a previous call to
4980 `glDeleteShader'. A value of 0 for PROGRAM will be silently ignored.
4982 To determine whether a program object has been flagged for deletion,
4983 call `glGetProgram' with arguments PROGRAM and `GL_DELETE_STATUS'.
4985 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
4988 `GL_INVALID_OPERATION' is generated if `glDeleteProgram' is executed
4989 between the execution of `glBegin' and the corresponding execution of
4992 (define-gl-procedures
4995 (ids const-GLuint-*)
4998 "Delete named query objects.
5001 Specifies the number of query objects to be deleted.
5004 Specifies an array of query objects to be deleted.
5006 `glDeleteQueries' deletes N query objects named by the elements of the
5007 array IDS. After a query object is deleted, it has no contents, and its
5008 name is free for reuse (for example by `glGenQueries').
5010 `glDeleteQueries' silently ignores 0's and names that do not correspond
5011 to existing query objects.
5013 `GL_INVALID_VALUE' is generated if N is negative.
5015 `GL_INVALID_OPERATION' is generated if `glDeleteQueries' is executed
5016 between the execution of `glBegin' and the corresponding execution of
5019 (define-gl-procedures
5020 ((glDeleteShader (shader GLuint) -> void))
5021 "Deletes a shader object.
5024 Specifies the shader object to be deleted.
5026 `glDeleteShader' frees the memory and invalidates the name associated
5027 with the shader object specified by SHADER. This command effectively
5028 undoes the effects of a call to `glCreateShader'.
5030 If a shader object to be deleted is attached to a program object, it
5031 will be flagged for deletion, but it will not be deleted until it is no
5032 longer attached to any program object, for any rendering context (i.e.,
5033 it must be detached from wherever it was attached before it will be
5034 deleted). A value of 0 for SHADER will be silently ignored.
5036 To determine whether an object has been flagged for deletion, call
5037 `glGetShader' with arguments SHADER and `GL_DELETE_STATUS'.
5039 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
5042 `GL_INVALID_OPERATION' is generated if `glDeleteShader' is executed
5043 between the execution of `glBegin' and the corresponding execution of
5046 (define-gl-procedures
5049 (textures const-GLuint-*)
5052 "Delete named textures.
5055 Specifies the number of textures to be deleted.
5058 Specifies an array of textures to be deleted.
5060 `glDeleteTextures' deletes N textures named by the elements of the array
5061 TEXTURES. After a texture is deleted, it has no contents or
5062 dimensionality, and its name is free for reuse (for example by
5063 `glGenTextures'). If a texture that is currently bound is deleted, the
5064 binding reverts to 0 (the default texture).
5066 `glDeleteTextures' silently ignores 0's and names that do not correspond
5067 to existing textures.
5069 `GL_INVALID_VALUE' is generated if N is negative.
5071 `GL_INVALID_OPERATION' is generated if `glDeleteTextures' is executed
5072 between the execution of `glBegin' and the corresponding execution of
5075 (define-gl-procedures
5076 ((glDepthFunc (func GLenum) -> void))
5077 "Specify the value used for depth buffer comparisons.
5080 Specifies the depth comparison function. Symbolic constants
5081 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
5082 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
5083 initial value is `GL_LESS'.
5085 `glDepthFunc' specifies the function used to compare each incoming pixel
5086 depth value with the depth value present in the depth buffer. The
5087 comparison is performed only if depth testing is enabled. (See
5088 `glEnable' and `glDisable' of `GL_DEPTH_TEST'.)
5090 FUNC specifies the conditions under which the pixel will be drawn. The
5091 comparison functions are as follows:
5097 Passes if the incoming depth value is less than the stored depth
5101 Passes if the incoming depth value is equal to the stored depth
5105 Passes if the incoming depth value is less than or equal to the
5109 Passes if the incoming depth value is greater than the stored depth
5113 Passes if the incoming depth value is not equal to the stored depth
5117 Passes if the incoming depth value is greater than or equal to the
5123 The initial value of FUNC is `GL_LESS'. Initially, depth testing is
5124 disabled. If depth testing is disabled or if no depth buffer exists, it
5125 is as if the depth test always passes.
5127 `GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
5129 `GL_INVALID_OPERATION' is generated if `glDepthFunc' is executed between
5130 the execution of `glBegin' and the corresponding execution of `glEnd'.")
5132 (define-gl-procedures
5133 ((glDepthMask (flag GLboolean) -> void))
5134 "Enable or disable writing into the depth buffer.
5137 Specifies whether the depth buffer is enabled for writing. If FLAG
5138 is `GL_FALSE', depth buffer writing is disabled. Otherwise, it is
5139 enabled. Initially, depth buffer writing is enabled.
5141 `glDepthMask' specifies whether the depth buffer is enabled for writing.
5142 If FLAG is `GL_FALSE', depth buffer writing is disabled. Otherwise, it
5143 is enabled. Initially, depth buffer writing is enabled.
5145 `GL_INVALID_OPERATION' is generated if `glDepthMask' is executed between
5146 the execution of `glBegin' and the corresponding execution of `glEnd'.")
5148 (define-gl-procedures
5154 "Specify mapping of depth values from normalized device coordinates to
5158 Specifies the mapping of the near clipping plane to window
5159 coordinates. The initial value is 0.
5162 Specifies the mapping of the far clipping plane to window
5163 coordinates. The initial value is 1.
5165 After clipping and division by W, depth coordinates range from -1 to 1,
5166 corresponding to the near and far clipping planes. `glDepthRange'
5167 specifies a linear mapping of the normalized depth coordinates in this
5168 range to window depth coordinates. Regardless of the actual depth buffer
5169 implementation, window coordinate depth values are treated as though
5170 they range from 0 through 1 (like color components). Thus, the values
5171 accepted by `glDepthRange' are both clamped to this range before they
5174 The setting of (0,1) maps the near plane to 0 and the far plane to 1.
5175 With this mapping, the depth buffer range is fully utilized.
5177 `GL_INVALID_OPERATION' is generated if `glDepthRange' is executed
5178 between the execution of `glBegin' and the corresponding execution of
5181 (define-gl-procedures
5187 "Detaches a shader object from a program object to which it is attached.
5190 Specifies the program object from which to detach the shader
5194 Specifies the shader object to be detached.
5196 `glDetachShader' detaches the shader object specified by SHADER from the
5197 program object specified by PROGRAM. This command can be used to undo
5198 the effect of the command `glAttachShader'.
5200 If SHADER has already been flagged for deletion by a call to
5201 `glDeleteShader' and it is not attached to any other program object, it
5202 will be deleted after it has been detached.
5204 `GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is a value
5205 that was not generated by OpenGL.
5207 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
5209 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
5211 `GL_INVALID_OPERATION' is generated if SHADER is not attached to
5214 `GL_INVALID_OPERATION' is generated if `glDetachShader' is executed
5215 between the execution of `glBegin' and the corresponding execution of
5218 (define-gl-procedures
5225 "Render primitives from array data.
5228 Specifies what kind of primitives to render. Symbolic constants
5229 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5230 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5231 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5234 Specifies the starting index in the enabled arrays.
5237 Specifies the number of indices to be rendered.
5239 `glDrawArrays' specifies multiple geometric primitives with very few
5240 subroutine calls. Instead of calling a GL procedure to pass each
5241 individual vertex, normal, texture coordinate, edge flag, or color, you
5242 can prespecify separate arrays of vertices, normals, and colors and use
5243 them to construct a sequence of primitives with a single call to
5246 When `glDrawArrays' is called, it uses COUNT sequential elements from
5247 each enabled array to construct a sequence of geometric primitives,
5248 beginning with element FIRST. MODE specifies what kind of primitives are
5249 constructed and how the array elements construct those primitives. If
5250 `GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
5252 Vertex attributes that are modified by `glDrawArrays' have an
5253 unspecified value after `glDrawArrays' returns. For example, if
5254 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5255 after `glDrawArrays' executes. Attributes that aren't modified remain
5258 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5260 `GL_INVALID_VALUE' is generated if COUNT is negative.
5262 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5263 bound to an enabled array and the buffer object's data store is
5266 `GL_INVALID_OPERATION' is generated if `glDrawArrays' is executed
5267 between the execution of `glBegin' and the corresponding `glEnd'.")
5269 (define-gl-procedures
5272 (bufs const-GLenum-*)
5275 "Specifies a list of color buffers to be drawn into.
5278 Specifies the number of buffers in BUFS.
5281 Points to an array of symbolic constants specifying the buffers
5282 into which fragment colors or data values will be written.
5284 `glDrawBuffers' defines an array of buffers into which fragment color
5285 values or fragment data will be written. If no fragment shader is
5286 active, rendering operations will generate only one fragment color per
5287 fragment and it will be written into each of the buffers specified by
5288 BUFS. If a fragment shader is active and it writes a value to the output
5289 variable `gl_FragColor', then that value will be written into each of
5290 the buffers specified by BUFS. If a fragment shader is active and it
5291 writes a value to one or more elements of the output array variable
5292 `gl_FragData[]', then the value of `gl_FragData[0] ' will be written
5293 into the first buffer specified by BUFS, the value of `gl_FragData[1] '
5294 will be written into the second buffer specified by BUFS, and so on up
5295 to `gl_FragData[n-1]'. The draw buffer used for `gl_FragData[n]' and
5296 beyond is implicitly set to be `GL_NONE'.
5298 The symbolic constants contained in BUFS may be any of the following:
5301 The fragment color/data value is not written into any color buffer.
5304 The fragment color/data value is written into the front left color
5308 The fragment color/data value is written into the front right color
5312 The fragment color/data value is written into the back left color
5316 The fragment color/data value is written into the back right color
5320 The fragment color/data value is written into auxiliary buffer `i'.
5322 Except for `GL_NONE', the preceding symbolic constants may not appear
5323 more than once in BUFS. The maximum number of draw buffers supported is
5324 implementation dependent and can be queried by calling `glGet' with the
5325 argument `GL_MAX_DRAW_BUFFERS'. The number of auxiliary buffers can be
5326 queried by calling `glGet' with the argument `GL_AUX_BUFFERS'.
5328 `GL_INVALID_ENUM' is generated if one of the values in BUFS is not an
5331 `GL_INVALID_ENUM' is generated if N is less than 0.
5333 `GL_INVALID_OPERATION' is generated if a symbolic constant other than
5334 `GL_NONE' appears more than once in BUFS.
5336 `GL_INVALID_OPERATION' is generated if any of the entries in BUFS (other
5337 than `GL_NONE' ) indicates a color buffer that does not exist in the
5340 `GL_INVALID_VALUE' is generated if N is greater than
5341 `GL_MAX_DRAW_BUFFERS'.
5343 `GL_INVALID_OPERATION' is generated if `glDrawBuffers' is executed
5344 between the execution of `glBegin' and the corresponding execution of
5347 (define-gl-procedures
5348 ((glDrawBuffer (mode GLenum) -> void))
5349 "Specify which color buffers are to be drawn into.
5352 Specifies up to four color buffers to be drawn into. Symbolic
5353 constants `GL_NONE', `GL_FRONT_LEFT', `GL_FRONT_RIGHT',
5354 `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT', `GL_BACK', `GL_LEFT',
5355 `GL_RIGHT', `GL_FRONT_AND_BACK', and `GL_AUX'I, where I is between
5356 0 and the value of `GL_AUX_BUFFERS' minus 1, are accepted.
5357 (`GL_AUX_BUFFERS' is not the upper limit; use `glGet' to query the
5358 number of available aux buffers.) The initial value is `GL_FRONT'
5359 for single-buffered contexts, and `GL_BACK' for double-buffered
5362 When colors are written to the frame buffer, they are written into the
5363 color buffers specified by `glDrawBuffer'. The specifications are as
5367 No color buffers are written.
5370 Only the front left color buffer is written.
5373 Only the front right color buffer is written.
5376 Only the back left color buffer is written.
5379 Only the back right color buffer is written.
5382 Only the front left and front right color buffers are written. If
5383 there is no front right color buffer, only the front left color
5387 Only the back left and back right color buffers are written. If
5388 there is no back right color buffer, only the back left color
5392 Only the front left and back left color buffers are written. If
5393 there is no back left color buffer, only the front left color
5397 Only the front right and back right color buffers are written. If
5398 there is no back right color buffer, only the front right color
5402 All the front and back color buffers (front left, front right, back
5403 left, back right) are written. If there are no back color buffers,
5404 only the front left and front right color buffers are written. If
5405 there are no right color buffers, only the front left and back left
5406 color buffers are written. If there are no right or back color
5407 buffers, only the front left color buffer is written.
5410 Only auxiliary color buffer I is written.
5412 If more than one color buffer is selected for drawing, then blending or
5413 logical operations are computed and applied independently for each color
5414 buffer and can produce different results in each buffer.
5416 Monoscopic contexts include only LEFT buffers, and stereoscopic contexts
5417 include both LEFT and RIGHT buffers. Likewise, single-buffered contexts
5418 include only FRONT buffers, and double-buffered contexts include both
5419 FRONT and BACK buffers. The context is selected at GL initialization.
5421 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5423 `GL_INVALID_OPERATION' is generated if none of the buffers indicated by
5426 `GL_INVALID_OPERATION' is generated if `glDrawBuffer' is executed
5427 between the execution of `glBegin' and the corresponding execution of
5430 (define-gl-procedures
5435 (indices const-GLvoid-*)
5438 "Render primitives from array data.
5441 Specifies what kind of primitives to render. Symbolic constants
5442 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5443 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5444 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5447 Specifies the number of elements to be rendered.
5450 Specifies the type of the values in INDICES. Must be one of
5451 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
5454 Specifies a pointer to the location where the indices are stored.
5456 `glDrawElements' specifies multiple geometric primitives with very few
5457 subroutine calls. Instead of calling a GL function to pass each
5458 individual vertex, normal, texture coordinate, edge flag, or color, you
5459 can prespecify separate arrays of vertices, normals, and so on, and use
5460 them to construct a sequence of primitives with a single call to
5463 When `glDrawElements' is called, it uses COUNT sequential elements from
5464 an enabled array, starting at INDICES to construct a sequence of
5465 geometric primitives. MODE specifies what kind of primitives are
5466 constructed and how the array elements construct these primitives. If
5467 more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
5468 not enabled, no geometric primitives are constructed.
5470 Vertex attributes that are modified by `glDrawElements' have an
5471 unspecified value after `glDrawElements' returns. For example, if
5472 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5473 after `glDrawElements' executes. Attributes that aren't modified
5474 maintain their previous values.
5476 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5478 `GL_INVALID_VALUE' is generated if COUNT is negative.
5480 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5481 bound to an enabled array or the element array and the buffer object's
5482 data store is currently mapped.
5484 `GL_INVALID_OPERATION' is generated if `glDrawElements' is executed
5485 between the execution of `glBegin' and the corresponding `glEnd'.")
5487 (define-gl-procedures
5493 (data const-GLvoid-*)
5496 "Write a block of pixels to the frame buffer.
5501 Specify the dimensions of the pixel rectangle to be written into
5505 Specifies the format of the pixel data. Symbolic constants
5506 `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT',
5507 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_RED', `GL_GREEN',
5508 `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA' are
5512 Specifies the data type for DATA. Symbolic constants
5513 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
5514 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
5515 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5516 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
5517 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5518 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5519 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5520 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
5524 Specifies a pointer to the pixel data.
5526 `glDrawPixels' reads pixel data from memory and writes it into the frame
5527 buffer relative to the current raster position, provided that the raster
5528 position is valid. Use `glRasterPos' or `glWindowPos' to set the current
5529 raster position; use `glGet' with argument
5530 `GL_CURRENT_RASTER_POSITION_VALID' to determine if the specified raster
5531 position is valid, and `glGet' with argument
5532 `GL_CURRENT_RASTER_POSITION' to query the raster position.
5534 Several parameters define the encoding of pixel data in memory and
5535 control the processing of the pixel data before it is placed in the
5536 frame buffer. These parameters are set with four commands:
5537 `glPixelStore', `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This
5538 reference page describes the effects on `glDrawPixels' of many, but not
5539 all, of the parameters specified by these four commands.
5541 Data is read from DATA as a sequence of signed or unsigned bytes, signed
5542 or unsigned shorts, signed or unsigned integers, or single-precision
5543 floating-point values, depending on TYPE. When TYPE is one of
5544 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
5545 `GL_UNSIGNED_INT', `GL_INT', or `GL_FLOAT' each of these bytes, shorts,
5546 integers, or floating-point values is interpreted as one color or depth
5547 component, or one index, depending on FORMAT. When TYPE is one of
5548 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_SHORT_5_6_5',
5549 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_5_5_5_1',
5550 `GL_UNSIGNED_INT_8_8_8_8', or `GL_UNSIGNED_INT_10_10_10_2', each
5551 unsigned value is interpreted as containing all the components for a
5552 single pixel, with the color components arranged according to FORMAT.
5553 When TYPE is one of `GL_UNSIGNED_BYTE_2_3_3_REV',
5554 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5555 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8_REV', or
5556 `GL_UNSIGNED_INT_2_10_10_10_REV', each unsigned value is interpreted as
5557 containing all color components, specified by FORMAT, for a single pixel
5558 in a reversed order. Indices are always treated individually. Color
5559 components are treated as groups of one, two, three, or four values,
5560 again based on FORMAT. Both individual indices and groups of components
5561 are referred to as pixels. If TYPE is `GL_BITMAP', the data must be
5562 unsigned bytes, and FORMAT must be either `GL_COLOR_INDEX' or
5563 `GL_STENCIL_INDEX'. Each unsigned byte is treated as eight 1-bit pixels,
5564 with bit ordering determined by `GL_UNPACK_LSB_FIRST' (see
5567 WIDTH×HEIGHT pixels are read from memory, starting at location DATA. By
5568 default, these pixels are taken from adjacent memory locations, except
5569 that after all WIDTH pixels are read, the read pointer is advanced to
5570 the next four-byte boundary. The four-byte row alignment is specified by
5571 `glPixelStore' with argument `GL_UNPACK_ALIGNMENT', and it can be set to
5572 one, two, four, or eight bytes. Other pixel store parameters specify
5573 different read pointer advancements, both before the first pixel is read
5574 and after all WIDTH pixels are read. See the `glPixelStore' reference
5575 page for details on these options.
5577 If a non-zero named buffer object is bound to the
5578 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a block of
5579 pixels is specified, DATA is treated as a byte offset into the buffer
5580 object's data store.
5582 The WIDTH×HEIGHT pixels that are read from memory are each operated on
5583 in the same way, based on the values of several parameters specified by
5584 `glPixelTransfer' and `glPixelMap'. The details of these operations, as
5585 well as the target buffer into which the pixels are drawn, are specific
5586 to the format of the pixels, as specified by FORMAT. FORMAT can assume
5587 one of 13 symbolic values:
5590 Each pixel is a single value, a color index. It is converted to
5591 fixed-point format, with an unspecified number of bits to the right
5592 of the binary point, regardless of the memory data type.
5593 Floating-point values convert to true fixed-point values. Signed
5594 and unsigned integer data is converted with all fraction bits set
5595 to 0. Bitmap data convert to either 0 or 1.
5597 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5598 bits and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5599 negative, the shift is to the right. In either case, zero bits fill
5600 otherwise unspecified bit locations in the result.
5602 If the GL is in RGBA mode, the resulting index is converted to an
5603 RGBA pixel with the help of the `GL_PIXEL_MAP_I_TO_R',
5604 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
5605 `GL_PIXEL_MAP_I_TO_A' tables. If the GL is in color index mode, and
5606 if `GL_MAP_COLOR' is true, the index is replaced with the value
5607 that it references in lookup table `GL_PIXEL_MAP_I_TO_I'. Whether
5608 the lookup replacement of the index is done or not, the integer
5609 part of the index is then ANDed with 2^B-1 , where B is the number
5610 of bits in a color index buffer.
5612 The GL then converts the resulting indices or RGBA colors to
5613 fragments by attaching the current raster position Z coordinate and
5614 texture coordinates to each pixel, then assigning X and Y window
5615 coordinates to the N th fragment such that X_N=X_R+N%WIDTH
5618 where (X_R,Y_R) is the current raster position. These pixel
5619 fragments are then treated just like the fragments generated by
5620 rasterizing points, lines, or polygons. Texture mapping, fog, and
5621 all the fragment operations are applied before the fragments are
5622 written to the frame buffer.
5625 Each pixel is a single value, a stencil index. It is converted to
5626 fixed-point format, with an unspecified number of bits to the right
5627 of the binary point, regardless of the memory data type.
5628 Floating-point values convert to true fixed-point values. Signed
5629 and unsigned integer data is converted with all fraction bits set
5630 to 0. Bitmap data convert to either 0 or 1.
5632 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5633 bits, and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5634 negative, the shift is to the right. In either case, zero bits fill
5635 otherwise unspecified bit locations in the result. If
5636 `GL_MAP_STENCIL' is true, the index is replaced with the value that
5637 it references in lookup table `GL_PIXEL_MAP_S_TO_S'. Whether the
5638 lookup replacement of the index is done or not, the integer part of
5639 the index is then ANDed with 2^B-1 , where B is the number of bits
5640 in the stencil buffer. The resulting stencil indices are then
5641 written to the stencil buffer such that the N th index is written
5644 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5646 where (X_R,Y_R) is the current raster position. Only the pixel
5647 ownership test, the scissor test, and the stencil writemask affect
5648 these write operations.
5650 `GL_DEPTH_COMPONENT'
5651 Each pixel is a single-depth component. Floating-point data is
5652 converted directly to an internal floating-point format with
5653 unspecified precision. Signed integer data is mapped linearly to
5654 the internal floating-point format such that the most positive
5655 representable integer value maps to 1.0, and the most negative
5656 representable value maps to -1.0 . Unsigned integer data is mapped
5657 similarly: the largest integer value maps to 1.0, and 0 maps to
5658 0.0. The resulting floating-point depth value is then multiplied by
5659 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
5660 clamped to the range [0,1] .
5662 The GL then converts the resulting depth components to fragments by
5663 attaching the current raster position color or color index and
5664 texture coordinates to each pixel, then assigning X and Y window
5665 coordinates to the N th fragment such that
5667 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5669 where (X_R,Y_R) is the current raster position. These pixel
5670 fragments are then treated just like the fragments generated by
5671 rasterizing points, lines, or polygons. Texture mapping, fog, and
5672 all the fragment operations are applied before the fragments are
5673 written to the frame buffer.
5677 Each pixel is a four-component group: For `GL_RGBA', the red
5678 component is first, followed by green, followed by blue, followed
5679 by alpha; for `GL_BGRA' the order is blue, green, red and then
5680 alpha. Floating-point values are converted directly to an internal
5681 floating-point format with unspecified precision. Signed integer
5682 values are mapped linearly to the internal floating-point format
5683 such that the most positive representable integer value maps to
5684 1.0, and the most negative representable value maps to -1.0 . (Note
5685 that this mapping does not convert 0 precisely to 0.0.) Unsigned
5686 integer data is mapped similarly: The largest integer value maps to
5687 1.0, and 0 maps to 0.0. The resulting floating-point color values
5688 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
5689 C is RED, GREEN, BLUE, and ALPHA for the respective color
5690 components. The results are clamped to the range [0,1] .
5692 If `GL_MAP_COLOR' is true, each color component is scaled by the
5693 size of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the
5694 value that it references in that table. C is R, G, B, or A
5697 The GL then converts the resulting RGBA colors to fragments by
5698 attaching the current raster position Z coordinate and texture
5699 coordinates to each pixel, then assigning X and Y window
5700 coordinates to the N th fragment such that
5702 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5704 where (X_R,Y_R) is the current raster position. These pixel
5705 fragments are then treated just like the fragments generated by
5706 rasterizing points, lines, or polygons. Texture mapping, fog, and
5707 all the fragment operations are applied before the fragments are
5708 written to the frame buffer.
5711 Each pixel is a single red component. This component is converted
5712 to the internal floating-point format in the same way the red
5713 component of an RGBA pixel is. It is then converted to an RGBA
5714 pixel with green and blue set to 0, and alpha set to 1. After this
5715 conversion, the pixel is treated as if it had been read as an RGBA
5719 Each pixel is a single green component. This component is converted
5720 to the internal floating-point format in the same way the green
5721 component of an RGBA pixel is. It is then converted to an RGBA
5722 pixel with red and blue set to 0, and alpha set to 1. After this
5723 conversion, the pixel is treated as if it had been read as an RGBA
5727 Each pixel is a single blue component. This component is converted
5728 to the internal floating-point format in the same way the blue
5729 component of an RGBA pixel is. It is then converted to an RGBA
5730 pixel with red and green set to 0, and alpha set to 1. After this
5731 conversion, the pixel is treated as if it had been read as an RGBA
5735 Each pixel is a single alpha component. This component is converted
5736 to the internal floating-point format in the same way the alpha
5737 component of an RGBA pixel is. It is then converted to an RGBA
5738 pixel with red, green, and blue set to 0. After this conversion,
5739 the pixel is treated as if it had been read as an RGBA pixel.
5743 Each pixel is a three-component group: red first, followed by
5744 green, followed by blue; for `GL_BGR', the first component is blue,
5745 followed by green and then red. Each component is converted to the
5746 internal floating-point format in the same way the red, green, and
5747 blue components of an RGBA pixel are. The color triple is converted
5748 to an RGBA pixel with alpha set to 1. After this conversion, the
5749 pixel is treated as if it had been read as an RGBA pixel.
5752 Each pixel is a single luminance component. This component is
5753 converted to the internal floating-point format in the same way the
5754 red component of an RGBA pixel is. It is then converted to an RGBA
5755 pixel with red, green, and blue set to the converted luminance
5756 value, and alpha set to 1. After this conversion, the pixel is
5757 treated as if it had been read as an RGBA pixel.
5759 `GL_LUMINANCE_ALPHA'
5760 Each pixel is a two-component group: luminance first, followed by
5761 alpha. The two components are converted to the internal
5762 floating-point format in the same way the red component of an RGBA
5763 pixel is. They are then converted to an RGBA pixel with red, green,
5764 and blue set to the converted luminance value, and alpha set to the
5765 converted alpha value. After this conversion, the pixel is treated
5766 as if it had been read as an RGBA pixel.
5768 The following table summarizes the meaning of the valid constants for
5774 *Corresponding Type*
5777 unsigned 8-bit integer
5780 signed 8-bit integer
5783 single bits in unsigned 8-bit integers
5786 unsigned 16-bit integer
5789 signed 16-bit integer
5792 unsigned 32-bit integer
5798 single-precision floating-point
5800 `GL_UNSIGNED_BYTE_3_3_2'
5801 unsigned 8-bit integer
5803 `GL_UNSIGNED_BYTE_2_3_3_REV'
5804 unsigned 8-bit integer with reversed component ordering
5806 `GL_UNSIGNED_SHORT_5_6_5'
5807 unsigned 16-bit integer
5809 `GL_UNSIGNED_SHORT_5_6_5_REV'
5810 unsigned 16-bit integer with reversed component ordering
5812 `GL_UNSIGNED_SHORT_4_4_4_4'
5813 unsigned 16-bit integer
5815 `GL_UNSIGNED_SHORT_4_4_4_4_REV'
5816 unsigned 16-bit integer with reversed component ordering
5818 `GL_UNSIGNED_SHORT_5_5_5_1'
5819 unsigned 16-bit integer
5821 `GL_UNSIGNED_SHORT_1_5_5_5_REV'
5822 unsigned 16-bit integer with reversed component ordering
5824 `GL_UNSIGNED_INT_8_8_8_8'
5825 unsigned 32-bit integer
5827 `GL_UNSIGNED_INT_8_8_8_8_REV'
5828 unsigned 32-bit integer with reversed component ordering
5830 `GL_UNSIGNED_INT_10_10_10_2'
5831 unsigned 32-bit integer
5833 `GL_UNSIGNED_INT_2_10_10_10_REV'
5834 unsigned 32-bit integer with reversed component ordering
5838 The rasterization described so far assumes pixel zoom factors of 1. If
5839 `glPixelZoom' is used to change the X and Y pixel zoom factors, pixels
5840 are converted to fragments as follows. If (X_R,Y_R) is the current
5841 raster position, and a given pixel is in the N th column and M th row of
5842 the pixel rectangle, then fragments are generated for pixels whose
5843 centers are in the rectangle with corners at
5845 (X_R+ZOOM_X,\u2062N,Y_R+ZOOM_Y,\u2062M) (X_R+ZOOM_X,\u2061(N+1,),Y_R+ZOOM_Y,\u2061(M+1,))
5847 where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
5850 `GL_INVALID_ENUM' is generated if FORMAT or TYPE is not one of the
5853 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
5854 either `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
5856 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
5858 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
5859 there is no stencil buffer.
5861 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_RED', `GL_GREEN',
5862 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_RGBA', `GL_BGR', `GL_BGRA',
5863 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA', and the GL is in color index
5866 `GL_INVALID_OPERATION' is generated if FORMAT is one of
5867 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5868 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
5871 `GL_INVALID_OPERATION' is generated if FORMAT is one of
5872 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5873 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5874 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5875 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
5876 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
5878 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5879 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
5880 data store is currently mapped.
5882 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5883 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
5884 unpacked from the buffer object such that the memory reads required
5885 would exceed the data store size.
5887 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5888 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
5889 divisible into the number of bytes needed to store in memory a datum
5892 `GL_INVALID_OPERATION' is generated if `glDrawPixels' is executed
5893 between the execution of `glBegin' and the corresponding execution of
5896 (define-gl-procedures
5897 ((glDrawRangeElements
5903 (indices const-GLvoid-*)
5906 "Render primitives from array data.
5909 Specifies what kind of primitives to render. Symbolic constants
5910 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5911 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5912 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5915 Specifies the minimum array index contained in INDICES.
5918 Specifies the maximum array index contained in INDICES.
5921 Specifies the number of elements to be rendered.
5924 Specifies the type of the values in INDICES. Must be one of
5925 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
5928 Specifies a pointer to the location where the indices are stored.
5930 `glDrawRangeElements' is a restricted form of `glDrawElements'. MODE,
5931 START, END, and COUNT match the corresponding arguments to
5932 `glDrawElements', with the additional constraint that all values in the
5933 arrays COUNT must lie between START and END, inclusive.
5935 Implementations denote recommended maximum amounts of vertex and index
5936 data, which may be queried by calling `glGet' with argument
5937 `GL_MAX_ELEMENTS_VERTICES' and `GL_MAX_ELEMENTS_INDICES'. If END-START+1
5938 is greater than the value of `GL_MAX_ELEMENTS_VERTICES', or if COUNT is
5939 greater than the value of `GL_MAX_ELEMENTS_INDICES', then the call may
5940 operate at reduced performance. There is no requirement that all
5941 vertices in the range [START,END] be referenced. However, the
5942 implementation may partially process unused vertices, reducing
5943 performance from what could be achieved with an optimal index set.
5945 When `glDrawRangeElements' is called, it uses COUNT sequential elements
5946 from an enabled array, starting at START to construct a sequence of
5947 geometric primitives. MODE specifies what kind of primitives are
5948 constructed, and how the array elements construct these primitives. If
5949 more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
5950 not enabled, no geometric primitives are constructed.
5952 Vertex attributes that are modified by `glDrawRangeElements' have an
5953 unspecified value after `glDrawRangeElements' returns. For example, if
5954 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5955 after `glDrawRangeElements' executes. Attributes that aren't modified
5956 maintain their previous values.
5958 It is an error for indices to lie outside the range [START,END] , but
5959 implementations may not check for this situation. Such indices cause
5960 implementation-dependent behavior.
5962 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5964 `GL_INVALID_VALUE' is generated if COUNT is negative.
5966 `GL_INVALID_VALUE' is generated if END<START .
5968 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5969 bound to an enabled array or the element array and the buffer object's
5970 data store is currently mapped.
5972 `GL_INVALID_OPERATION' is generated if `glDrawRangeElements' is executed
5973 between the execution of `glBegin' and the corresponding `glEnd'.")
5975 (define-gl-procedures
5978 (pointer const-GLvoid-*)
5981 "Define an array of edge flags.
5984 Specifies the byte offset between consecutive edge flags. If STRIDE
5985 is 0, the edge flags are understood to be tightly packed in the
5986 array. The initial value is 0.
5989 Specifies a pointer to the first edge flag in the array. The
5992 `glEdgeFlagPointer' specifies the location and data format of an array
5993 of boolean edge flags to use when rendering. STRIDE specifies the byte
5994 stride from one edge flag to the next, allowing vertices and attributes
5995 to be packed into a single array or stored in separate arrays.
5997 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
5998 target (see `glBindBuffer') while an edge flag array is specified,
5999 POINTER is treated as a byte offset into the buffer object's data store.
6000 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
6001 edge flag vertex array client-side state
6002 (`GL_EDGE_FLAG_ARRAY_BUFFER_BINDING').
6004 When an edge flag array is specified, STRIDE and POINTER are saved as
6005 client-side state, in addition to the current vertex array buffer object
6008 To enable and disable the edge flag array, call `glEnableClientState'
6009 and `glDisableClientState' with the argument `GL_EDGE_FLAG_ARRAY'. If
6010 enabled, the edge flag array is used when `glDrawArrays',
6011 `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
6012 `glDrawRangeElements', or `glArrayElement' is called.
6014 `GL_INVALID_ENUM' is generated if STRIDE is negative.")
6016 (define-gl-procedures
6017 ((glEdgeFlag (flag GLboolean) -> void))
6018 "Flag edges as either boundary or nonboundary.
6021 Specifies the current edge flag value, either `GL_TRUE' or
6022 `GL_FALSE'. The initial value is `GL_TRUE'.
6024 Each vertex of a polygon, separate triangle, or separate quadrilateral
6025 specified between a `glBegin'/`glEnd' pair is marked as the start of
6026 either a boundary or nonboundary edge. If the current edge flag is true
6027 when the vertex is specified, the vertex is marked as the start of a
6028 boundary edge. Otherwise, the vertex is marked as the start of a
6029 nonboundary edge. `glEdgeFlag' sets the edge flag bit to `GL_TRUE' if
6030 FLAG is `GL_TRUE' and to `GL_FALSE' otherwise.
6032 The vertices of connected triangles and connected quadrilaterals are
6033 always marked as boundary, regardless of the value of the edge flag.
6035 Boundary and nonboundary edge flags on vertices are significant only if
6036 `GL_POLYGON_MODE' is set to `GL_POINT' or `GL_LINE'. See
6039 (define-gl-procedures
6040 ((glEnableClientState (cap GLenum) -> void)
6041 (glDisableClientState (cap GLenum) -> void))
6042 "Enable or disable client-side capability.
6045 Specifies the capability to enable. Symbolic constants
6046 `GL_COLOR_ARRAY', `GL_EDGE_FLAG_ARRAY', `GL_FOG_COORD_ARRAY',
6047 `GL_INDEX_ARRAY', `GL_NORMAL_ARRAY', `GL_SECONDARY_COLOR_ARRAY',
6048 `GL_TEXTURE_COORD_ARRAY', and `GL_VERTEX_ARRAY' are accepted.
6050 `glEnableClientState' and `glDisableClientState' enable or disable
6051 individual client-side capabilities. By default, all client-side
6052 capabilities are disabled. Both `glEnableClientState' and
6053 `glDisableClientState' take a single argument, CAP, which can assume one
6054 of the following values:
6057 If enabled, the color array is enabled for writing and used during
6058 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6059 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6060 is called. See `glColorPointer'.
6062 `GL_EDGE_FLAG_ARRAY'
6063 If enabled, the edge flag array is enabled for writing and used
6064 during rendering when `glArrayElement', `glDrawArrays',
6065 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6066 `glMultiDrawElements' is called. See `glEdgeFlagPointer'.
6068 `GL_FOG_COORD_ARRAY'
6069 If enabled, the fog coordinate array is enabled for writing and
6070 used during rendering when `glArrayElement', `glDrawArrays',
6071 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6072 `glMultiDrawElements' is called. See `glFogCoordPointer'.
6075 If enabled, the index array is enabled for writing and used during
6076 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6077 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6078 is called. See `glIndexPointer'.
6081 If enabled, the normal array is enabled for writing and used during
6082 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6083 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6084 is called. See `glNormalPointer'.
6086 `GL_SECONDARY_COLOR_ARRAY'
6087 If enabled, the secondary color array is enabled for writing and
6088 used during rendering when `glArrayElement', `glDrawArrays',
6089 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6090 `glMultiDrawElements' is called. See `glColorPointer'.
6092 `GL_TEXTURE_COORD_ARRAY'
6093 If enabled, the texture coordinate array is enabled for writing and
6094 used during rendering when `glArrayElement', `glDrawArrays',
6095 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6096 `glMultiDrawElements' is called. See `glTexCoordPointer'.
6099 If enabled, the vertex array is enabled for writing and used during
6100 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6101 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6102 is called. See `glVertexPointer'.
6104 `GL_INVALID_ENUM' is generated if CAP is not an accepted value.
6106 `glEnableClientState' is not allowed between the execution of `glBegin'
6107 and the corresponding `glEnd', but an error may or may not be generated.
6108 If no error is generated, the behavior is undefined.")
6110 (define-gl-procedures
6111 ((glEnableVertexAttribArray
6115 (glDisableVertexAttribArray
6119 "Enable or disable a generic vertex attribute array.
6122 Specifies the index of the generic vertex attribute to be enabled
6125 `glEnableVertexAttribArray' enables the generic vertex attribute array
6126 specified by INDEX. `glDisableVertexAttribArray' disables the generic
6127 vertex attribute array specified by INDEX. By default, all client-side
6128 capabilities are disabled, including all generic vertex attribute
6129 arrays. If enabled, the values in the generic vertex attribute array
6130 will be accessed and used for rendering when calls are made to vertex
6131 array commands such as `glDrawArrays', `glDrawElements',
6132 `glDrawRangeElements', `glArrayElement', `glMultiDrawElements', or
6133 `glMultiDrawArrays'.
6135 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
6136 `GL_MAX_VERTEX_ATTRIBS'.
6138 `GL_INVALID_OPERATION' is generated if either `glEnableVertexAttribArray
6139 ' or `glDisableVertexAttribArray ' is executed between the execution of
6140 `glBegin' and the corresponding execution of `glEnd'.")
6142 (define-gl-procedures
6143 ((glEnable (cap GLenum) -> void)
6144 (glDisable (cap GLenum) -> void))
6145 "Enable or disable server-side GL capabilities.
6148 Specifies a symbolic constant indicating a GL capability.
6150 `glEnable' and `glDisable' enable and disable various capabilities. Use
6151 `glIsEnabled' or `glGet' to determine the current setting of any
6152 capability. The initial value for each capability with the exception of
6153 `GL_DITHER' and `GL_MULTISAMPLE' is `GL_FALSE'. The initial value for
6154 `GL_DITHER' and `GL_MULTISAMPLE' is `GL_TRUE'.
6156 Both `glEnable' and `glDisable' take a single argument, CAP, which can
6157 assume one of the following values:
6162 If enabled, do alpha testing. See `glAlphaFunc'.
6167 If enabled, generate normal vectors when either `GL_MAP2_VERTEX_3'
6168 or `GL_MAP2_VERTEX_4' is used to generate vertices. See `glMap2'.
6173 If enabled, blend the computed fragment color values with the
6174 values in the color buffers. See `glBlendFunc'.
6179 If enabled, clip geometry against user-defined clipping plane I.
6185 If enabled, apply the currently selected logical operation to the
6186 computed fragment color and color buffer values. See `glLogicOp'.
6191 If enabled, have one or more material parameters track the current
6192 color. See `glColorMaterial'.
6197 If enabled and no fragment shader is active, add the secondary
6198 color value to the computed fragment color. See `glSecondaryColor'.
6203 If enabled, perform a color table lookup on the incoming RGBA color
6204 values. See `glColorTable'.
6209 If enabled, perform a 1D convolution operation on incoming RGBA
6210 color values. See `glConvolutionFilter1D'.
6215 If enabled, perform a 2D convolution operation on incoming RGBA
6216 color values. See `glConvolutionFilter2D'.
6221 If enabled, cull polygons based on their winding in window
6222 coordinates. See `glCullFace'.
6227 If enabled, do depth comparisons and update the depth buffer. Note
6228 that even if the depth buffer exists and the depth mask is
6229 non-zero, the depth buffer is not updated if the depth test is
6230 disabled. See `glDepthFunc' and `glDepthRange'.
6235 If enabled, dither color components or indices before they are
6236 written to the color buffer.
6241 If enabled and no fragment shader is active, blend a fog color into
6242 the post-texturing color. See `glFog'.
6247 If enabled, histogram incoming RGBA color values. See
6253 If enabled, apply the currently selected logical operation to the
6254 incoming index and color buffer indices. See `glLogicOp'.
6259 If enabled, include light I in the evaluation of the lighting
6260 equation. See `glLightModel' and `glLight'.
6265 If enabled and no vertex shader is active, use the current lighting
6266 parameters to compute the vertex color or index. Otherwise, simply
6267 associate the current color or index with each vertex. See
6268 `glMaterial', `glLightModel', and `glLight'.
6273 If enabled, draw lines with correct filtering. Otherwise, draw
6274 aliased lines. See `glLineWidth'.
6279 If enabled, use the current line stipple pattern when drawing
6280 lines. See `glLineStipple'.
6285 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6286 `glEvalPoint1' generate RGBA values. See `glMap1'.
6291 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6292 `glEvalPoint1' generate color indices. See `glMap1'.
6297 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6298 `glEvalPoint1' generate normals. See `glMap1'.
6300 `GL_MAP1_TEXTURE_COORD_1'
6303 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6304 `glEvalPoint1' generate S texture coordinates. See `glMap1'.
6306 `GL_MAP1_TEXTURE_COORD_2'
6309 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6310 `glEvalPoint1' generate S and T texture coordinates. See `glMap1'.
6312 `GL_MAP1_TEXTURE_COORD_3'
6315 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6316 `glEvalPoint1' generate S, T, and R texture coordinates. See
6319 `GL_MAP1_TEXTURE_COORD_4'
6322 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6323 `glEvalPoint1' generate S, T, R, and Q texture coordinates. See
6329 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6330 `glEvalPoint1' generate X, Y, and Z vertex coordinates. See
6336 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6337 `glEvalPoint1' generate homogeneous X, Y, Z, and W vertex
6338 coordinates. See `glMap1'.
6343 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6344 `glEvalPoint2' generate RGBA values. See `glMap2'.
6349 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6350 `glEvalPoint2' generate color indices. See `glMap2'.
6355 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6356 `glEvalPoint2' generate normals. See `glMap2'.
6358 `GL_MAP2_TEXTURE_COORD_1'
6361 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6362 `glEvalPoint2' generate S texture coordinates. See `glMap2'.
6364 `GL_MAP2_TEXTURE_COORD_2'
6367 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6368 `glEvalPoint2' generate S and T texture coordinates. See `glMap2'.
6370 `GL_MAP2_TEXTURE_COORD_3'
6373 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6374 `glEvalPoint2' generate S, T, and R texture coordinates. See
6377 `GL_MAP2_TEXTURE_COORD_4'
6380 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6381 `glEvalPoint2' generate S, T, R, and Q texture coordinates. See
6387 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6388 `glEvalPoint2' generate X, Y, and Z vertex coordinates. See
6394 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6395 `glEvalPoint2' generate homogeneous X, Y, Z, and W vertex
6396 coordinates. See `glMap2'.
6401 If enabled, compute the minimum and maximum values of incoming RGBA
6402 color values. See `glMinmax'.
6407 If enabled, use multiple fragment samples in computing the final
6408 color of a pixel. See `glSampleCoverage'.
6413 If enabled and no vertex shader is active, normal vectors are
6414 normalized to unit length after transformation and before lighting.
6415 This method is generally less efficient than `GL_RESCALE_NORMAL'.
6416 See `glNormal' and `glNormalPointer'.
6421 If enabled, draw points with proper filtering. Otherwise, draw
6422 aliased points. See `glPointSize'.
6427 If enabled, calculate texture coordinates for points based on
6428 texture environment and point parameter settings. Otherwise texture
6429 coordinates are constant across points.
6431 `GL_POLYGON_OFFSET_FILL'
6434 If enabled, and if the polygon is rendered in `GL_FILL' mode, an
6435 offset is added to depth values of a polygon's fragments before the
6436 depth comparison is performed. See `glPolygonOffset'.
6438 `GL_POLYGON_OFFSET_LINE'
6441 If enabled, and if the polygon is rendered in `GL_LINE' mode, an
6442 offset is added to depth values of a polygon's fragments before the
6443 depth comparison is performed. See `glPolygonOffset'.
6445 `GL_POLYGON_OFFSET_POINT'
6448 If enabled, an offset is added to depth values of a polygon's
6449 fragments before the depth comparison is performed, if the polygon
6450 is rendered in `GL_POINT' mode. See `glPolygonOffset'.
6455 If enabled, draw polygons with proper filtering. Otherwise, draw
6456 aliased polygons. For correct antialiased polygons, an alpha buffer
6457 is needed and the polygons must be sorted front to back.
6459 `GL_POLYGON_STIPPLE'
6462 If enabled, use the current polygon stipple pattern when rendering
6463 polygons. See `glPolygonStipple'.
6465 `GL_POST_COLOR_MATRIX_COLOR_TABLE'
6468 If enabled, perform a color table lookup on RGBA color values after
6469 color matrix transformation. See `glColorTable'.
6471 `GL_POST_CONVOLUTION_COLOR_TABLE'
6474 If enabled, perform a color table lookup on RGBA color values after
6475 convolution. See `glColorTable'.
6480 If enabled and no vertex shader is active, normal vectors are
6481 scaled after transformation and before lighting by a factor
6482 computed from the modelview matrix. If the modelview matrix scales
6483 space uniformly, this has the effect of restoring the transformed
6484 normal to unit length. This method is generally more efficient than
6485 `GL_NORMALIZE'. See `glNormal' and `glNormalPointer'.
6487 `GL_SAMPLE_ALPHA_TO_COVERAGE'
6490 If enabled, compute a temporary coverage value where each bit is
6491 determined by the alpha value at the corresponding sample location.
6492 The temporary coverage value is then ANDed with the fragment
6495 `GL_SAMPLE_ALPHA_TO_ONE'
6498 If enabled, each sample alpha value is replaced by the maximum
6499 representable alpha value.
6501 `GL_SAMPLE_COVERAGE'
6504 If enabled, the fragment's coverage is ANDed with the temporary
6505 coverage value. If `GL_SAMPLE_COVERAGE_INVERT' is set to `GL_TRUE',
6506 invert the coverage value. See `glSampleCoverage'.
6511 If enabled, perform a two-dimensional convolution operation using a
6512 separable convolution filter on incoming RGBA color values. See
6513 `glSeparableFilter2D'.
6518 If enabled, discard fragments that are outside the scissor
6519 rectangle. See `glScissor'.
6524 If enabled, do stencil testing and update the stencil buffer. See
6525 `glStencilFunc' and `glStencilOp'.
6530 If enabled and no fragment shader is active, one-dimensional
6531 texturing is performed (unless two- or three-dimensional or
6532 cube-mapped texturing is also enabled). See `glTexImage1D'.
6537 If enabled and no fragment shader is active, two-dimensional
6538 texturing is performed (unless three-dimensional or cube-mapped
6539 texturing is also enabled). See `glTexImage2D'.
6544 If enabled and no fragment shader is active, three-dimensional
6545 texturing is performed (unless cube-mapped texturing is also
6546 enabled). See `glTexImage3D'.
6548 `GL_TEXTURE_CUBE_MAP'
6551 If enabled and no fragment shader is active, cube-mapped texturing
6552 is performed. See `glTexImage2D'.
6557 If enabled and no vertex shader is active, the Q texture coordinate
6558 is computed using the texture generation function defined with
6559 `glTexGen'. Otherwise, the current Q texture coordinate is used.
6565 If enabled and no vertex shader is active, the R texture coordinate
6566 is computed using the texture generation function defined with
6567 `glTexGen'. Otherwise, the current R texture coordinate is used.
6573 If enabled and no vertex shader is active, the S texture coordinate
6574 is computed using the texture generation function defined with
6575 `glTexGen'. Otherwise, the current S texture coordinate is used.
6581 If enabled and no vertex shader is active, the T texture coordinate
6582 is computed using the texture generation function defined with
6583 `glTexGen'. Otherwise, the current T texture coordinate is used.
6586 `GL_VERTEX_PROGRAM_POINT_SIZE'
6589 If enabled and a vertex shader is active, then the derived point
6590 size is taken from the (potentially clipped) shader builtin
6591 `gl_PointSize' and clamped to the implementation-dependent point
6594 `GL_VERTEX_PROGRAM_TWO_SIDE'
6597 If enabled and a vertex shader is active, it specifies that the GL
6598 will choose between front and back colors based on the polygon's
6599 face direction of which the vertex being shaded is a part. It has
6600 no effect on points or lines.
6602 `GL_INVALID_ENUM' is generated if CAP is not one of the values listed
6605 `GL_INVALID_OPERATION' is generated if `glEnable' or `glDisable' is
6606 executed between the execution of `glBegin' and the corresponding
6607 execution of `glEnd'.")
6609 (define-gl-procedures
6610 ((glEvalCoord1f (u GLfloat) -> void)
6611 (glEvalCoord2f (u GLfloat) (v GLfloat) -> void))
6612 "Evaluate enabled one- and two-dimensional maps.
6615 Specifies a value that is the domain coordinate U to the basis
6616 function defined in a previous `glMap1' or `glMap2' command.
6619 Specifies a value that is the domain coordinate V to the basis
6620 function defined in a previous `glMap2' command. This argument is
6621 not present in a `glEvalCoord1' command.
6623 `glEvalCoord1' evaluates enabled one-dimensional maps at argument U.
6624 `glEvalCoord2' does the same for two-dimensional maps using two domain
6625 values, U and V. To define a map, call `glMap1' and `glMap2'; to enable
6626 and disable it, call `glEnable' and `glDisable'.
6628 When one of the `glEvalCoord' commands is issued, all currently enabled
6629 maps of the indicated dimension are evaluated. Then, for each enabled
6630 map, it is as if the corresponding GL command had been issued with the
6631 computed value. That is, if `GL_MAP1_INDEX' or `GL_MAP2_INDEX' is
6632 enabled, a `glIndex' command is simulated. If `GL_MAP1_COLOR_4' or
6633 `GL_MAP2_COLOR_4' is enabled, a `glColor' command is simulated. If
6634 `GL_MAP1_NORMAL' or `GL_MAP2_NORMAL' is enabled, a normal vector is
6635 produced, and if any of `GL_MAP1_TEXTURE_COORD_1',
6636 `GL_MAP1_TEXTURE_COORD_2', `GL_MAP1_TEXTURE_COORD_3',
6637 `GL_MAP1_TEXTURE_COORD_4', `GL_MAP2_TEXTURE_COORD_1',
6638 `GL_MAP2_TEXTURE_COORD_2', `GL_MAP2_TEXTURE_COORD_3', or
6639 `GL_MAP2_TEXTURE_COORD_4' is enabled, then an appropriate `glTexCoord'
6640 command is simulated.
6642 For color, color index, normal, and texture coordinates the GL uses
6643 evaluated values instead of current values for those evaluations that
6644 are enabled, and current values otherwise, However, the evaluated values
6645 do not update the current values. Thus, if `glVertex' commands are
6646 interspersed with `glEvalCoord' commands, the color, normal, and texture
6647 coordinates associated with the `glVertex' commands are not affected by
6648 the values generated by the `glEvalCoord' commands, but only by the most
6649 recent `glColor', `glIndex', `glNormal', and `glTexCoord' commands.
6651 No commands are issued for maps that are not enabled. If more than one
6652 texture evaluation is enabled for a particular dimension (for example,
6653 `GL_MAP2_TEXTURE_COORD_1' and `GL_MAP2_TEXTURE_COORD_2'), then only the
6654 evaluation of the map that produces the larger number of coordinates (in
6655 this case, `GL_MAP2_TEXTURE_COORD_2') is carried out. `GL_MAP1_VERTEX_4'
6656 overrides `GL_MAP1_VERTEX_3', and `GL_MAP2_VERTEX_4' overrides
6657 `GL_MAP2_VERTEX_3', in the same manner. If neither a three- nor a
6658 four-component vertex map is enabled for the specified dimension, the
6659 `glEvalCoord' command is ignored.
6661 If you have enabled automatic normal generation, by calling `glEnable'
6662 with argument `GL_AUTO_NORMAL', `glEvalCoord2' generates surface normals
6663 analytically, regardless of the contents or enabling of the
6664 `GL_MAP2_NORMAL' map. Let
6666 `m'=∂`p',/∂U,,×∂`p',/∂V,,
6668 Then the generated normal `n' is `n'=`m'/∥`m',∥,
6670 If automatic normal generation is disabled, the corresponding normal map
6671 `GL_MAP2_NORMAL', if enabled, is used to produce a normal. If neither
6672 automatic normal generation nor a normal map is enabled, no normal is
6673 generated for `glEvalCoord2' commands.")
6675 (define-gl-procedures
6690 "Compute a one- or two-dimensional grid of points or lines.
6693 In `glEvalMesh1', specifies whether to compute a one-dimensional
6694 mesh of points or lines. Symbolic constants `GL_POINT' and
6695 `GL_LINE' are accepted.
6700 Specify the first and last integer values for grid domain variable
6703 `glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
6704 and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
6705 steps through the integer domain of a one- or two-dimensional grid,
6706 whose range is the domain of the evaluation maps specified by `glMap1'
6707 and `glMap2'. MODE determines whether the resulting vertices are
6708 connected as points, lines, or filled polygons.
6710 In the one-dimensional case, `glEvalMesh1', the mesh is generated as if
6711 the following code fragment were executed:
6717 for ( i = I1; i <= I2; i += 1 )
6718 glEvalCoord1( i·ΔU+U_1
6725 and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
6726 command. TYPE is `GL_POINTS' if MODE is `GL_POINT', or `GL_LINES' if
6729 The one absolute numeric requirement is that if I=N , then the value
6730 computed from I·ΔU+U_1 is exactly U_2 .
6732 In the two-dimensional case, `glEvalMesh2', let .cp ΔU=(U_2-U_1,)/N
6736 where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
6737 recent `glMapGrid2' command. Then, if MODE is `GL_FILL', the
6738 `glEvalMesh2' command is equivalent to:
6743 for ( j = J1; j < J2; j += 1 ) {
6744 glBegin( GL_QUAD_STRIP );
6745 for ( i = I1; i <= I2; i += 1 ) {
6746 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6749 glEvalCoord2( i·ΔU+U_1,(j+1,)·ΔV+V_1
6756 If MODE is `GL_LINE', then a call to `glEvalMesh2' is equivalent to:
6761 for ( j = J1; j <= J2; j += 1 ) {
6762 glBegin( GL_LINE_STRIP );
6763 for ( i = I1; i <= I2; i += 1 )
6764 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6770 for ( i = I1; i <= I2; i += 1 ) {
6771 glBegin( GL_LINE_STRIP );
6772 for ( j = J1; j <= J1; j += 1 )
6773 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6779 And finally, if MODE is `GL_POINT', then a call to `glEvalMesh2' is
6785 glBegin( GL_POINTS );
6786 for ( j = J1; j <= J2; j += 1 )
6787 for ( i = I1; i <= I2; i += 1 )
6788 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6793 In all three cases, the only absolute numeric requirements are that if
6794 I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
6795 , then the value computed from J·ΔV+V_1 is exactly V_2 .
6797 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
6799 `GL_INVALID_OPERATION' is generated if `glEvalMesh' is executed between
6800 the execution of `glBegin' and the corresponding execution of `glEnd'.")
6802 (define-gl-procedures
6803 ((glEvalPoint1 (i GLint) -> void)
6804 (glEvalPoint2 (i GLint) (j GLint) -> void))
6805 "Generate and evaluate a single point in a mesh.
6808 Specifies the integer value for grid domain variable I .
6811 Specifies the integer value for grid domain variable J
6812 (`glEvalPoint2' only).
6814 `glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
6815 and evaluate a series of evenly spaced map domain values. `glEvalPoint'
6816 can be used to evaluate a single grid point in the same gridspace that
6817 is traversed by `glEvalMesh'. Calling `glEvalPoint1' is equivalent to
6818 calling where ΔU=(U_2-U_1,)/N
6821 glEvalCoord1( i·ΔU+U_1
6825 and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
6826 command. The one absolute numeric requirement is that if I=N , then the
6827 value computed from I·ΔU+U_1 is exactly U_2 .
6829 In the two-dimensional case, `glEvalPoint2', let
6831 ΔU=(U_2-U_1,)/N ΔV=(V_2-V_1,)/M
6833 where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
6834 recent `glMapGrid2' command. Then the `glEvalPoint2' command is
6835 equivalent to calling The only absolute numeric requirements are that if
6836 I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
6837 , then the value computed from J·ΔV+V_1 is exactly V_2 .
6840 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6844 (define-gl-procedures
6851 "Controls feedback mode.
6854 Specifies the maximum number of values that can be written into
6858 Specifies a symbolic constant that describes the information that
6859 will be returned for each vertex. `GL_2D', `GL_3D', `GL_3D_COLOR',
6860 `GL_3D_COLOR_TEXTURE', and `GL_4D_COLOR_TEXTURE' are accepted.
6863 Returns the feedback data.
6865 The `glFeedbackBuffer' function controls feedback. Feedback, like
6866 selection, is a GL mode. The mode is selected by calling `glRenderMode'
6867 with `GL_FEEDBACK'. When the GL is in feedback mode, no pixels are
6868 produced by rasterization. Instead, information about primitives that
6869 would have been rasterized is fed back to the application using the GL.
6871 `glFeedbackBuffer' has three arguments: BUFFER is a pointer to an array
6872 of floating-point values into which feedback information is placed. SIZE
6873 indicates the size of the array. TYPE is a symbolic constant describing
6874 the information that is fed back for each vertex. `glFeedbackBuffer'
6875 must be issued before feedback mode is enabled (by calling
6876 `glRenderMode' with argument `GL_FEEDBACK'). Setting `GL_FEEDBACK'
6877 without establishing the feedback buffer, or calling `glFeedbackBuffer'
6878 while the GL is in feedback mode, is an error.
6880 When `glRenderMode' is called while in feedback mode, it returns the
6881 number of entries placed in the feedback array and resets the feedback
6882 array pointer to the base of the feedback buffer. The returned value
6883 never exceeds SIZE. If the feedback data required more room than was
6884 available in BUFFER, `glRenderMode' returns a negative value. To take
6885 the GL out of feedback mode, call `glRenderMode' with a parameter value
6886 other than `GL_FEEDBACK'.
6888 While in feedback mode, each primitive, bitmap, or pixel rectangle that
6889 would be rasterized generates a block of values that are copied into the
6890 feedback array. If doing so would cause the number of entries to exceed
6891 the maximum, the block is partially written so as to fill the array (if
6892 there is any room left at all), and an overflow flag is set. Each block
6893 begins with a code indicating the primitive type, followed by values
6894 that describe the primitive's vertices and associated data. Entries are
6895 also written for bitmaps and pixel rectangles. Feedback occurs after
6896 polygon culling and `glPolygonMode' interpretation of polygons has taken
6897 place, so polygons that are culled are not returned in the feedback
6898 buffer. It can also occur after polygons with more than three edges are
6899 broken up into triangles, if the GL implementation renders polygons by
6900 performing this decomposition.
6902 The `glPassThrough' command can be used to insert a marker into the
6903 feedback buffer. See `glPassThrough'.
6905 Following is the grammar for the blocks of values written into the
6906 feedback buffer. Each primitive is indicated with a unique identifying
6907 value followed by some number of vertices. Polygon entries include an
6908 integer value indicating how many vertices follow. A vertex is fed back
6909 as some number of floating-point values, as determined by TYPE. Colors
6910 are fed back as four values in RGBA mode and one value in color index
6913 feedbackList ← feedbackItem feedbackList | feedbackItem feedbackItem ←
6914 point | lineSegment | polygon | bitmap | pixelRectangle | passThru point
6915 ← `GL_POINT_TOKEN' vertex lineSegment ← `GL_LINE_TOKEN' vertex vertex |
6916 `GL_LINE_RESET_TOKEN' vertex vertex polygon ← `GL_POLYGON_TOKEN' n
6917 polySpec polySpec ← polySpec vertex | vertex vertex vertex bitmap ←
6918 `GL_BITMAP_TOKEN' vertex pixelRectangle ← `GL_DRAW_PIXEL_TOKEN' vertex |
6919 `GL_COPY_PIXEL_TOKEN' vertex passThru ← `GL_PASS_THROUGH_TOKEN' value
6920 vertex ← 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture 2d ← value
6921 value 3d ← value value value 3dColor ← value value value color
6922 3dColorTexture ← value value value color tex 4dColorTexture ← value
6923 value value value color tex color ← rgba | index rgba ← value value
6924 value value index ← value tex ← value value value value
6926 VALUE is a floating-point number, and N is a floating-point integer
6927 giving the number of vertices in the polygon. `GL_POINT_TOKEN',
6928 `GL_LINE_TOKEN', `GL_LINE_RESET_TOKEN', `GL_POLYGON_TOKEN',
6929 `GL_BITMAP_TOKEN', `GL_DRAW_PIXEL_TOKEN', `GL_COPY_PIXEL_TOKEN' and
6930 `GL_PASS_THROUGH_TOKEN' are symbolic floating-point constants.
6931 `GL_LINE_RESET_TOKEN' is returned whenever the line stipple pattern is
6932 reset. The data returned as a vertex depends on the feedback TYPE.
6934 The following table gives the correspondence between TYPE and the number
6935 of values per vertex. K is 1 in color index mode and 4 in RGBA mode.
6940 *Coordinates*, *Color*, *Texture*, *Total Number of Values*
6951 `GL_3D_COLOR_TEXTURE'
6952 X, Y, Z, K , 4 , 7+K
6954 `GL_4D_COLOR_TEXTURE'
6955 X, Y, Z, W, K , 4 , 8+K
6957 Feedback vertex coordinates are in window coordinates, except W, which
6958 is in clip coordinates. Feedback colors are lighted, if lighting is
6959 enabled. Feedback texture coordinates are generated, if texture
6960 coordinate generation is enabled. They are always transformed by the
6963 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
6965 `GL_INVALID_VALUE' is generated if SIZE is negative.
6967 `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
6968 while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
6969 with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
6972 `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is executed
6973 between the execution of `glBegin' and the corresponding execution of
6976 (define-gl-procedures
6977 ((glFinish -> void))
6978 "Block until all GL execution is complete.
6980 `glFinish' does not return until the effects of all previously called GL
6981 commands are complete. Such effects include all changes to GL state, all
6982 changes to connection state, and all changes to the frame buffer
6985 `GL_INVALID_OPERATION' is generated if `glFinish' is executed between
6986 the execution of `glBegin' and the corresponding execution of `glEnd'.")
6988 (define-gl-procedures
6990 "Force execution of GL commands in finite time.
6992 Different GL implementations buffer commands in several different
6993 locations, including network buffers and the graphics accelerator
6994 itself. `glFlush' empties all of these buffers, causing all issued
6995 commands to be executed as quickly as they are accepted by the actual
6996 rendering engine. Though this execution may not be completed in any
6997 particular time period, it does complete in finite time.
6999 Because any GL program might be executed over a network, or on an
7000 accelerator that buffers commands, all programs should call `glFlush'
7001 whenever they count on having all of their previously issued commands
7002 completed. For example, call `glFlush' before waiting for user input
7003 that depends on the generated image.
7005 `GL_INVALID_OPERATION' is generated if `glFlush' is executed between the
7006 execution of `glBegin' and the corresponding execution of `glEnd'.")
7008 (define-gl-procedures
7015 "Define an array of fog coordinates.
7018 Specifies the data type of each fog coordinate. Symbolic constants
7019 `GL_FLOAT', or `GL_DOUBLE' are accepted. The initial value is
7023 Specifies the byte offset between consecutive fog coordinates. If
7024 STRIDE is 0, the array elements are understood to be tightly
7025 packed. The initial value is 0.
7028 Specifies a pointer to the first coordinate of the first fog
7029 coordinate in the array. The initial value is 0.
7031 `glFogCoordPointer' specifies the location and data format of an array
7032 of fog coordinates to use when rendering. TYPE specifies the data type
7033 of each fog coordinate, and STRIDE specifies the byte stride from one
7034 fog coordinate to the next, allowing vertices and attributes to be
7035 packed into a single array or stored in separate arrays.
7037 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
7038 target (see `glBindBuffer') while a fog coordinate array is specified,
7039 POINTER is treated as a byte offset into the buffer object's data store.
7040 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
7041 fog coordinate vertex array client-side state
7042 (`GL_FOG_COORD_ARRAY_BUFFER_BINDING').
7044 When a fog coordinate array is specified, TYPE, STRIDE, and POINTER are
7045 saved as client-side state, in addition to the current vertex array
7046 buffer object binding.
7048 To enable and disable the fog coordinate array, call
7049 `glEnableClientState' and `glDisableClientState' with the argument
7050 `GL_FOG_COORD_ARRAY'. If enabled, the fog coordinate array is used when
7051 `glDrawArrays', `glMultiDrawArrays', `glDrawElements',
7052 `glMultiDrawElements', `glDrawRangeElements', or `glArrayElement' is
7055 `GL_INVALID_ENUM' is generated if TYPE is not either `GL_FLOAT' or
7058 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
7060 (define-gl-procedures
7061 ((glFogCoordf (coord GLfloat) -> void))
7062 "Set the current fog coordinates.
7065 Specify the fog distance.
7067 `glFogCoord' specifies the fog coordinate that is associated with each
7068 vertex and the current raster position. The value specified is
7069 interpolated and used in computing the fog color (see `glFog').")
7071 (define-gl-procedures
7072 ((glFogf (pname GLenum) (param GLfloat) -> void)
7073 (glFogi (pname GLenum) (param GLint) -> void))
7074 "Specify fog parameters.
7077 Specifies a single-valued fog parameter. `GL_FOG_MODE',
7078 `GL_FOG_DENSITY', `GL_FOG_START', `GL_FOG_END', `GL_FOG_INDEX', and
7079 `GL_FOG_COORD_SRC' are accepted.
7082 Specifies the value that PNAME will be set to.
7084 Fog is initially disabled. While enabled, fog affects rasterized
7085 geometry, bitmaps, and pixel blocks, but not buffer clear operations. To
7086 enable and disable fog, call `glEnable' and `glDisable' with argument
7089 `glFog' assigns the value or values in PARAMS to the fog parameter
7090 specified by PNAME. The following values are accepted for PNAME:
7093 PARAMS is a single integer or floating-point value that specifies
7094 the equation to be used to compute the fog blend factor, F . Three
7095 symbolic constants are accepted: `GL_LINEAR', `GL_EXP', and
7096 `GL_EXP2'. The equations corresponding to these symbolic constants
7097 are defined below. The initial fog mode is `GL_EXP'.
7100 PARAMS is a single integer or floating-point value that specifies
7101 DENSITY , the fog density used in both exponential fog equations.
7102 Only nonnegative densities are accepted. The initial fog density is
7106 PARAMS is a single integer or floating-point value that specifies
7107 START , the near distance used in the linear fog equation. The
7108 initial near distance is 0.
7111 PARAMS is a single integer or floating-point value that specifies
7112 END , the far distance used in the linear fog equation. The initial
7116 PARAMS is a single integer or floating-point value that specifies
7117 I_F , the fog color index. The initial fog index is 0.
7120 PARAMS contains four integer or floating-point values that specify
7121 C_F , the fog color. Integer values are mapped linearly such that
7122 the most positive representable value maps to 1.0, and the most
7123 negative representable value maps to -1.0 . Floating-point values
7124 are mapped directly. After conversion, all color components are
7125 clamped to the range [0,1] . The initial fog color is (0, 0, 0, 0).
7128 PARAMS contains either of the following symbolic constants:
7129 `GL_FOG_COORD' or `GL_FRAGMENT_DEPTH'. `GL_FOG_COORD' specifies
7130 that the current fog coordinate should be used as distance value in
7131 the fog color computation. `GL_FRAGMENT_DEPTH' specifies that the
7132 current fragment depth should be used as distance value in the fog
7135 Fog blends a fog color with each rasterized pixel fragment's
7136 post-texturing color using a blending factor F . Factor F is computed in
7137 one of three ways, depending on the fog mode. Let C be either the
7138 distance in eye coordinate from the origin (in the case that the
7139 `GL_FOG_COORD_SRC' is `GL_FRAGMENT_DEPTH') or the current fog coordinate
7140 (in the case that `GL_FOG_COORD_SRC' is `GL_FOG_COORD'). The equation
7141 for `GL_LINEAR' fog is F=END-C,/END-START,
7143 The equation for `GL_EXP' fog is F=E^-(DENSITY·C,),
7145 The equation for `GL_EXP2' fog is F=E^-(DENSITY·C,),^2
7147 Regardless of the fog mode, F is clamped to the range [0,1] after it is
7148 computed. Then, if the GL is in RGBA color mode, the fragment's red,
7149 green, and blue colors, represented by C_R , are replaced by
7151 C_R,^″=F×C_R+(1-F,)×C_F
7153 Fog does not affect a fragment's alpha component.
7155 In color index mode, the fragment's color index I_R is replaced by
7157 I_R,^″=I_R+(1-F,)×I_F
7161 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value, or if
7162 PNAME is `GL_FOG_MODE' and PARAMS is not an accepted value.
7164 `GL_INVALID_VALUE' is generated if PNAME is `GL_FOG_DENSITY' and PARAMS
7167 `GL_INVALID_OPERATION' is generated if `glFog' is executed between the
7168 execution of `glBegin' and the corresponding execution of `glEnd'.")
7170 (define-gl-procedures
7171 ((glFrontFace (mode GLenum) -> void))
7172 "Define front- and back-facing polygons.
7175 Specifies the orientation of front-facing polygons. `GL_CW' and
7176 `GL_CCW' are accepted. The initial value is `GL_CCW'.
7178 In a scene composed entirely of opaque closed surfaces, back-facing
7179 polygons are never visible. Eliminating these invisible polygons has the
7180 obvious benefit of speeding up the rendering of the image. To enable and
7181 disable elimination of back-facing polygons, call `glEnable' and
7182 `glDisable' with argument `GL_CULL_FACE'.
7184 The projection of a polygon to window coordinates is said to have
7185 clockwise winding if an imaginary object following the path from its
7186 first vertex, its second vertex, and so on, to its last vertex, and
7187 finally back to its first vertex, moves in a clockwise direction about
7188 the interior of the polygon. The polygon's winding is said to be
7189 counterclockwise if the imaginary object following the same path moves
7190 in a counterclockwise direction about the interior of the polygon.
7191 `glFrontFace' specifies whether polygons with clockwise winding in
7192 window coordinates, or counterclockwise winding in window coordinates,
7193 are taken to be front-facing. Passing `GL_CCW' to MODE selects
7194 counterclockwise polygons as front-facing; `GL_CW' selects clockwise
7195 polygons as front-facing. By default, counterclockwise polygons are
7196 taken to be front-facing.
7198 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
7200 `GL_INVALID_OPERATION' is generated if `glFrontFace' is executed between
7201 the execution of `glBegin' and the corresponding execution of `glEnd'.")
7203 (define-gl-procedures
7213 "Multiply the current matrix by a perspective matrix.
7218 Specify the coordinates for the left and right vertical clipping
7224 Specify the coordinates for the bottom and top horizontal clipping
7230 Specify the distances to the near and far depth clipping planes.
7231 Both distances must be positive.
7233 `glFrustum' describes a perspective matrix that produces a perspective
7234 projection. The current matrix (see `glMatrixMode') is multiplied by
7235 this matrix and the result replaces the current matrix, as if
7236 `glMultMatrix' were called with the following matrix as its argument:
7240 [(2\u2062NEARVAL,/RIGHT-LEFT,, 0 A 0), (0 2\u2062NEARVAL,/TOP-BOTTOM,, B 0), (0 0
7243 A=RIGHT+LEFT,/RIGHT-LEFT,
7245 B=TOP+BOTTOM,/TOP-BOTTOM,
7247 C=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
7249 D=-2\u2062FARVAL\u2062NEARVAL,/FARVAL-NEARVAL,,
7253 Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
7254 and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
7255 that are mapped to the lower left and upper right corners of the window,
7256 assuming that the eye is located at (0, 0, 0). -FARVAL specifies the
7257 location of the far clipping plane. Both NEARVAL and FARVAL must be
7260 Use `glPushMatrix' and `glPopMatrix' to save and restore the current
7263 `GL_INVALID_VALUE' is generated if NEARVAL or FARVAL is not positive, or
7264 if LEFT = RIGHT, or BOTTOM = TOP, or NEAR = FAR.
7266 `GL_INVALID_OPERATION' is generated if `glFrustum' is executed between
7267 the execution of `glBegin' and the corresponding execution of `glEnd'.")
7269 (define-gl-procedures
7275 "Generate buffer object names.
7278 Specifies the number of buffer object names to be generated.
7281 Specifies an array in which the generated buffer object names are
7284 `glGenBuffers' returns N buffer object names in BUFFERS. There is no
7285 guarantee that the names form a contiguous set of integers; however, it
7286 is guaranteed that none of the returned names was in use immediately
7287 before the call to `glGenBuffers'.
7289 Buffer object names returned by a call to `glGenBuffers' are not
7290 returned by subsequent calls, unless they are first deleted with
7293 No buffer objects are associated with the returned buffer object names
7294 until they are first bound by calling `glBindBuffer'.
7296 `GL_INVALID_VALUE' is generated if N is negative.
7298 `GL_INVALID_OPERATION' is generated if `glGenBuffers' is executed
7299 between the execution of `glBegin' and the corresponding execution of
7302 (define-gl-procedures
7303 ((glGenLists (range GLsizei) -> GLuint))
7304 "Generate a contiguous set of empty display lists.
7307 Specifies the number of contiguous empty display lists to be
7310 `glGenLists' has one argument, RANGE. It returns an integer N such that
7311 RANGE contiguous empty display lists, named N , N+1 , ... , N+RANGE-1 ,
7312 are created. If RANGE is 0, if there is no group of RANGE contiguous
7313 names available, or if any error is generated, no display lists are
7314 generated, and 0 is returned.
7316 `GL_INVALID_VALUE' is generated if RANGE is negative.
7318 `GL_INVALID_OPERATION' is generated if `glGenLists' is executed between
7319 the execution of `glBegin' and the corresponding execution of `glEnd'.")
7321 (define-gl-procedures
7322 ((glGenQueries (n GLsizei) (ids GLuint-*) -> void))
7323 "Generate query object names.
7326 Specifies the number of query object names to be generated.
7329 Specifies an array in which the generated query object names are
7332 `glGenQueries' returns N query object names in IDS. There is no
7333 guarantee that the names form a contiguous set of integers; however, it
7334 is guaranteed that none of the returned names was in use immediately
7335 before the call to `glGenQueries'.
7337 Query object names returned by a call to `glGenQueries' are not returned
7338 by subsequent calls, unless they are first deleted with
7341 No query objects are associated with the returned query object names
7342 until they are first used by calling `glBeginQuery'.
7344 `GL_INVALID_VALUE' is generated if N is negative.
7346 `GL_INVALID_OPERATION' is generated if `glGenQueries' is executed
7347 between the execution of `glBegin' and the corresponding execution of
7350 (define-gl-procedures
7356 "Generate texture names.
7359 Specifies the number of texture names to be generated.
7362 Specifies an array in which the generated texture names are stored.
7364 `glGenTextures' returns N texture names in TEXTURES. There is no
7365 guarantee that the names form a contiguous set of integers; however, it
7366 is guaranteed that none of the returned names was in use immediately
7367 before the call to `glGenTextures'.
7369 The generated textures have no dimensionality; they assume the
7370 dimensionality of the texture target to which they are first bound (see
7373 Texture names returned by a call to `glGenTextures' are not returned by
7374 subsequent calls, unless they are first deleted with `glDeleteTextures'.
7376 `GL_INVALID_VALUE' is generated if N is negative.
7378 `GL_INVALID_OPERATION' is generated if `glGenTextures' is executed
7379 between the execution of `glBegin' and the corresponding execution of
7382 (define-gl-procedures
7393 "Returns information about an active attribute variable for the specified
7397 Specifies the program object to be queried.
7400 Specifies the index of the attribute variable to be queried.
7403 Specifies the maximum number of characters OpenGL is allowed to
7404 write in the character buffer indicated by NAME.
7407 Returns the number of characters actually written by OpenGL in the
7408 string indicated by NAME (excluding the null terminator) if a value
7409 other than `NULL' is passed.
7412 Returns the size of the attribute variable.
7415 Returns the data type of the attribute variable.
7418 Returns a null terminated string containing the name of the
7421 `glGetActiveAttrib' returns information about an active attribute
7422 variable in the program object specified by PROGRAM. The number of
7423 active attributes can be obtained by calling `glGetProgram' with the
7424 value `GL_ACTIVE_ATTRIBUTES'. A value of 0 for INDEX selects the first
7425 active attribute variable. Permissible values for INDEX range from 0 to
7426 the number of active attribute variables minus 1.
7428 A vertex shader may use either built-in attribute variables,
7429 user-defined attribute variables, or both. Built-in attribute variables
7430 have a prefix of \"gl_\" and reference conventional OpenGL vertex
7431 attribtes (e.g., GL_VERTEX, GL_NORMAL, etc., see the OpenGL Shading
7432 Language specification for a complete list.) User-defined attribute
7433 variables have arbitrary names and obtain their values through numbered
7434 generic vertex attributes. An attribute variable (either built-in or
7435 user-defined) is considered active if it is determined during the link
7436 operation that it may be accessed during program execution. Therefore,
7437 PROGRAM should have previously been the target of a call to
7438 `glLinkProgram', but it is not necessary for it to have been linked
7441 The size of the character buffer required to store the longest attribute
7442 variable name in PROGRAM can be obtained by calling `glGetProgram' with
7443 the value `GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'. This value should be used to
7444 allocate a buffer of sufficient size to store the returned attribute
7445 name. The size of this character buffer is passed in BUFSIZE, and a
7446 pointer to this character buffer is passed in NAME.
7448 `glGetActiveAttrib' returns the name of the attribute variable indicated
7449 by INDEX, storing it in the character buffer specified by NAME. The
7450 string returned will be null terminated. The actual number of characters
7451 written into this buffer is returned in LENGTH, and this count does not
7452 include the null termination character. If the length of the returned
7453 string is not required, a value of `NULL' can be passed in the LENGTH
7456 The TYPE argument will return a pointer to the attribute variable's data
7457 type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7458 `GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3',
7459 `GL_FLOAT_MAT4', `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4',
7460 `GL_FLOAT_MAT3x2', `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', or
7461 `GL_FLOAT_MAT4x3' may be returned. The SIZE argument will return the
7462 size of the attribute, in units of the type returned in TYPE.
7464 The list of active attribute variables may include both built-in
7465 attribute variables (which begin with the prefix \"gl_\") as well as
7466 user-defined attribute variable names.
7468 This function will return as much information as it can about the
7469 specified active attribute variable. If no information is available,
7470 LENGTH will be 0, and NAME will be an empty string. This situation could
7471 occur if this function is called after a link operation that failed. If
7472 an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7475 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7478 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7480 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7481 number of active attribute variables in PROGRAM.
7483 `GL_INVALID_OPERATION' is generated if `glGetActiveAttrib' is executed
7484 between the execution of `glBegin' and the corresponding execution of
7487 `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7489 (define-gl-procedures
7490 ((glGetActiveUniform
7500 "Returns information about an active uniform variable for the specified
7504 Specifies the program object to be queried.
7507 Specifies the index of the uniform variable to be queried.
7510 Specifies the maximum number of characters OpenGL is allowed to
7511 write in the character buffer indicated by NAME.
7514 Returns the number of characters actually written by OpenGL in the
7515 string indicated by NAME (excluding the null terminator) if a value
7516 other than `NULL' is passed.
7519 Returns the size of the uniform variable.
7522 Returns the data type of the uniform variable.
7525 Returns a null terminated string containing the name of the uniform
7528 `glGetActiveUniform' returns information about an active uniform
7529 variable in the program object specified by PROGRAM. The number of
7530 active uniform variables can be obtained by calling `glGetProgram' with
7531 the value `GL_ACTIVE_UNIFORMS'. A value of 0 for INDEX selects the first
7532 active uniform variable. Permissible values for INDEX range from 0 to
7533 the number of active uniform variables minus 1.
7535 Shaders may use either built-in uniform variables, user-defined uniform
7536 variables, or both. Built-in uniform variables have a prefix of \"gl_\"
7537 and reference existing OpenGL state or values derived from such state
7538 (e.g., GL_FOG, GL_MODELVIEWMATRIX, etc., see the OpenGL Shading Language
7539 specification for a complete list.) User-defined uniform variables have
7540 arbitrary names and obtain their values from the application through
7541 calls to `glUniform'. A uniform variable (either built-in or
7542 user-defined) is considered active if it is determined during the link
7543 operation that it may be accessed during program execution. Therefore,
7544 PROGRAM should have previously been the target of a call to
7545 `glLinkProgram', but it is not necessary for it to have been linked
7548 The size of the character buffer required to store the longest uniform
7549 variable name in PROGRAM can be obtained by calling `glGetProgram' with
7550 the value `GL_ACTIVE_UNIFORM_MAX_LENGTH'. This value should be used to
7551 allocate a buffer of sufficient size to store the returned uniform
7552 variable name. The size of this character buffer is passed in BUFSIZE,
7553 and a pointer to this character buffer is passed in NAME.
7555 `glGetActiveUniform' returns the name of the uniform variable indicated
7556 by INDEX, storing it in the character buffer specified by NAME. The
7557 string returned will be null terminated. The actual number of characters
7558 written into this buffer is returned in LENGTH, and this count does not
7559 include the null termination character. If the length of the returned
7560 string is not required, a value of `NULL' can be passed in the LENGTH
7563 The TYPE argument will return a pointer to the uniform variable's data
7564 type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7565 `GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_INT', `GL_INT_VEC2',
7566 `GL_INT_VEC3', `GL_INT_VEC4', `GL_BOOL', `GL_BOOL_VEC2', `GL_BOOL_VEC3',
7567 `GL_BOOL_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3', `GL_FLOAT_MAT4',
7568 `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4', `GL_FLOAT_MAT3x2',
7569 `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', `GL_FLOAT_MAT4x3',
7570 `GL_SAMPLER_1D', `GL_SAMPLER_2D', `GL_SAMPLER_3D', `GL_SAMPLER_CUBE',
7571 `GL_SAMPLER_1D_SHADOW', or `GL_SAMPLER_2D_SHADOW' may be returned.
7573 If one or more elements of an array are active, the name of the array is
7574 returned in NAME, the type is returned in TYPE, and the SIZE parameter
7575 returns the highest array element index used, plus one, as determined by
7576 the compiler and/or linker. Only one active uniform variable will be
7577 reported for a uniform array.
7579 Uniform variables that are declared as structures or arrays of
7580 structures will not be returned directly by this function. Instead, each
7581 of these uniform variables will be reduced to its fundamental components
7582 containing the \".\" and \"[]\" operators such that each of the names is
7583 valid as an argument to `glGetUniformLocation'. Each of these reduced
7584 uniform variables is counted as one active uniform variable and is
7585 assigned an index. A valid name cannot be a structure, an array of
7586 structures, or a subcomponent of a vector or matrix.
7588 The size of the uniform variable will be returned in SIZE. Uniform
7589 variables other than arrays will have a size of 1. Structures and arrays
7590 of structures will be reduced as described earlier, such that each of
7591 the names returned will be a data type in the earlier list. If this
7592 reduction results in an array, the size returned will be as described
7593 for uniform arrays; otherwise, the size returned will be 1.
7595 The list of active uniform variables may include both built-in uniform
7596 variables (which begin with the prefix \"gl_\") as well as user-defined
7597 uniform variable names.
7599 This function will return as much information as it can about the
7600 specified active uniform variable. If no information is available,
7601 LENGTH will be 0, and NAME will be an empty string. This situation could
7602 occur if this function is called after a link operation that failed. If
7603 an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7606 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7609 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7611 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7612 number of active uniform variables in PROGRAM.
7614 `GL_INVALID_OPERATION' is generated if `glGetActiveUniform' is executed
7615 between the execution of `glBegin' and the corresponding execution of
7618 `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7620 (define-gl-procedures
7621 ((glGetAttachedShaders
7628 "Returns the handles of the shader objects attached to a program object.
7631 Specifies the program object to be queried.
7634 Specifies the size of the array for storing the returned object
7638 Returns the number of names actually returned in OBJECTS.
7641 Specifies an array that is used to return the names of attached
7644 `glGetAttachedShaders' returns the names of the shader objects attached
7645 to PROGRAM. The names of shader objects that are attached to PROGRAM
7646 will be returned in SHADERS. The actual number of shader names written
7647 into SHADERS is returned in COUNT. If no shader objects are attached to
7648 PROGRAM, COUNT is set to 0. The maximum number of shader names that may
7649 be returned in SHADERS is specified by MAXCOUNT.
7651 If the number of names actually returned is not required (for instance,
7652 if it has just been obtained by calling `glGetProgram'), a value of
7653 `NULL' may be passed for count. If no shader objects are attached to
7654 PROGRAM, a value of 0 will be returned in COUNT. The actual number of
7655 attached shaders can be obtained by calling `glGetProgram' with the
7656 value `GL_ATTACHED_SHADERS'.
7658 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7661 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7663 `GL_INVALID_VALUE' is generated if MAXCOUNT is less than 0.
7665 `GL_INVALID_OPERATION' is generated if `glGetAttachedShaders' is
7666 executed between the execution of `glBegin' and the corresponding
7667 execution of `glEnd'.")
7669 (define-gl-procedures
7670 ((glGetAttribLocation
7672 (name const-GLchar-*)
7675 "Returns the location of an attribute variable.
7678 Specifies the program object to be queried.
7681 Points to a null terminated string containing the name of the
7682 attribute variable whose location is to be queried.
7684 `glGetAttribLocation' queries the previously linked program object
7685 specified by PROGRAM for the attribute variable specified by NAME and
7686 returns the index of the generic vertex attribute that is bound to that
7687 attribute variable. If NAME is a matrix attribute variable, the index of
7688 the first column of the matrix is returned. If the named attribute
7689 variable is not an active attribute in the specified program object or
7690 if NAME starts with the reserved prefix \"gl_\", a value of -1 is
7693 The association between an attribute variable name and a generic
7694 attribute index can be specified at any time by calling
7695 `glBindAttribLocation'. Attribute bindings do not go into effect until
7696 `glLinkProgram' is called. After a program object has been linked
7697 successfully, the index values for attribute variables remain fixed
7698 until the next link command occurs. The attribute values can only be
7699 queried after a link if the link was successful. `glGetAttribLocation'
7700 returns the binding that actually went into effect the last time
7701 `glLinkProgram' was called for the specified program object. Attribute
7702 bindings that have been specified since the last link operation are not
7703 returned by `glGetAttribLocation'.
7705 `GL_INVALID_OPERATION' is generated if PROGRAM is not a value generated
7708 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7710 `GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
7713 `GL_INVALID_OPERATION' is generated if `glGetAttribLocation' is executed
7714 between the execution of `glBegin' and the corresponding execution of
7717 (define-gl-procedures
7718 ((glGetBufferSubData
7725 "Returns a subset of a buffer object's data store.
7728 Specifies the target buffer object. The symbolic constant must be
7729 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
7730 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
7733 Specifies the offset into the buffer object's data store from which
7734 data will be returned, measured in bytes.
7737 Specifies the size in bytes of the data store region being
7741 Specifies a pointer to the location where buffer object data is
7744 `glGetBufferSubData' returns some or all of the data from the buffer
7745 object currently bound to TARGET. Data starting at byte offset OFFSET
7746 and extending for SIZE bytes is copied from the data store to the memory
7747 pointed to by DATA. An error is thrown if the buffer object is currently
7748 mapped, or if OFFSET and SIZE together define a range beyond the bounds
7749 of the buffer object's data store.
7751 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
7752 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
7753 `GL_PIXEL_UNPACK_BUFFER'.
7755 `GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
7756 together they define a region of memory that extends beyond the buffer
7757 object's allocated data store.
7759 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
7762 `GL_INVALID_OPERATION' is generated if the buffer object being queried
7765 `GL_INVALID_OPERATION' is generated if `glGetBufferSubData' is executed
7766 between the execution of `glBegin' and the corresponding execution of
7769 (define-gl-procedures
7772 (equation GLdouble-*)
7775 "Return the coefficients of the specified clipping plane.
7778 Specifies a clipping plane. The number of clipping planes depends
7779 on the implementation, but at least six clipping planes are
7780 supported. They are identified by symbolic names of the form
7781 `GL_CLIP_PLANE' I where i ranges from 0 to the value of
7782 `GL_MAX_CLIP_PLANES' - 1.
7785 Returns four double-precision values that are the coefficients of
7786 the plane equation of PLANE in eye coordinates. The initial value
7789 `glGetClipPlane' returns in EQUATION the four coefficients of the plane
7792 `GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
7794 `GL_INVALID_OPERATION' is generated if `glGetClipPlane' is executed
7795 between the execution of `glBegin' and the corresponding execution of
7798 (define-gl-procedures
7806 "Retrieve contents of a color lookup table.
7809 Must be `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
7810 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
7813 The format of the pixel data in TABLE. The possible values are
7814 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
7815 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
7818 The type of the pixel data in TABLE. Symbolic constants
7819 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
7820 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
7821 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
7822 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
7823 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
7824 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
7825 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
7826 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
7830 Pointer to a one-dimensional array of pixel data containing the
7831 contents of the color table.
7833 `glGetColorTable' returns in TABLE the contents of the color table
7834 specified by TARGET. No pixel transfer operations are performed, but
7835 pixel storage modes that are applicable to `glReadPixels' are performed.
7837 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
7838 target (see `glBindBuffer') while a histogram table is requested, TABLE
7839 is treated as a byte offset into the buffer object's data store.
7841 Color components that are requested in the specified FORMAT, but which
7842 are not included in the internal format of the color lookup table, are
7843 returned as zero. The assignments of internal color components to the
7844 components requested by FORMAT are
7846 *Internal Component*
7847 *Resulting Component*
7869 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
7872 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
7875 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
7878 `GL_INVALID_OPERATION' is generated if TYPE is one of
7879 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
7880 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
7883 `GL_INVALID_OPERATION' is generated if TYPE is one of
7884 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
7885 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
7886 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
7887 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
7888 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
7890 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7891 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
7892 store is currently mapped.
7894 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7895 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
7896 to the buffer object such that the memory writes required would exceed
7897 the data store size.
7899 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7900 bound to the `GL_PIXEL_PACK_BUFFER' target and TABLE is not evenly
7901 divisible into the number of bytes needed to store in memory a datum
7904 `GL_INVALID_OPERATION' is generated if `glGetColorTable' is executed
7905 between the execution of `glBegin' and the corresponding execution of
7908 (define-gl-procedures
7909 ((glGetCompressedTexImage
7915 "Return a compressed texture image.
7918 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
7919 `GL_TEXTURE_2D', and
7920 `GL_TEXTURE_3D'`GL_TEXTURE_CUBE_MAP_POSITIVE_X',
7921 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
7922 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
7923 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
7926 Specifies the level-of-detail number of the desired image. Level 0
7927 is the base image level. Level N is the N th mipmap reduction
7931 Returns the compressed texture image.
7933 `glGetCompressedTexImage' returns the compressed texture image
7934 associated with TARGET and LOD into IMG. IMG should be an array of
7935 `GL_TEXTURE_COMPRESSED_IMAGE_SIZE' bytes. TARGET specifies whether the
7936 desired texture image was one specified by `glTexImage1D'
7937 (`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
7938 `GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LOD
7939 specifies the level-of-detail number of the desired image.
7941 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
7942 target (see `glBindBuffer') while a texture image is requested, IMG is
7943 treated as a byte offset into the buffer object's data store.
7945 To minimize errors, first verify that the texture is compressed by
7946 calling `glGetTexLevelParameter' with argument `GL_TEXTURE_COMPRESSED'.
7947 If the texture is compressed, then determine the amount of memory
7948 required to store the compressed texture by calling
7949 `glGetTexLevelParameter' with argument
7950 `GL_TEXTURE_COMPRESSED_IMAGE_SIZE'. Finally, retrieve the internal
7951 format of the texture by calling `glGetTexLevelParameter' with argument
7952 `GL_TEXTURE_INTERNAL_FORMAT'. To store the texture for later use,
7953 associate the internal format and size with the retrieved texture image.
7954 These data can be used by the respective texture or subtexture loading
7955 routine used for loading TARGET textures.
7957 `GL_INVALID_VALUE' is generated if LOD is less than zero or greater than
7958 the maximum number of LODs permitted by the implementation.
7960 `GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is used
7961 to retrieve a texture that is in an uncompressed internal format.
7963 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7964 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
7965 store is currently mapped.
7967 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7968 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
7969 to the buffer object such that the memory writes required would exceed
7970 the data store size.
7972 `GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is
7973 executed between the execution of `glBegin' and the corresponding
7974 execution of `glEnd'.")
7976 (define-gl-procedures
7977 ((glGetConvolutionFilter
7984 "Get current 1D or 2D convolution filter kernel.
7987 The filter to be retrieved. Must be one of `GL_CONVOLUTION_1D' or
7988 `GL_CONVOLUTION_2D'.
7991 Format of the output image. Must be one of `GL_RED', `GL_GREEN',
7992 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
7993 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
7996 Data type of components in the output image. Symbolic constants
7997 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
7998 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
7999 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8000 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8001 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8002 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8003 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8004 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8008 Pointer to storage for the output image.
8010 `glGetConvolutionFilter' returns the current 1D or 2D convolution filter
8011 kernel as an image. The one- or two-dimensional image is placed in IMAGE
8012 according to the specifications in FORMAT and TYPE. No pixel transfer
8013 operations are performed on this image, but the relevant pixel storage
8016 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8017 target (see `glBindBuffer') while a convolution filter is requested,
8018 IMAGE is treated as a byte offset into the buffer object's data store.
8020 Color components that are present in FORMAT but not included in the
8021 internal format of the filter are returned as zero. The assignments of
8022 internal color components to the components of FORMAT are as follows.
8024 *Internal Component*
8025 *Resulting Component*
8047 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8050 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8053 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8056 `GL_INVALID_OPERATION' is generated if TYPE is one of
8057 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8058 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8061 `GL_INVALID_OPERATION' is generated if TYPE is one of
8062 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8063 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8064 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8065 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8066 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8068 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8069 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8070 store is currently mapped.
8072 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8073 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8074 to the buffer object such that the memory writes required would exceed
8075 the data store size.
8077 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8078 bound to the `GL_PIXEL_PACK_BUFFER' target and IMAGE is not evenly
8079 divisible into the number of bytes needed to store in memory a datum
8082 `GL_INVALID_OPERATION' is generated if `glGetConvolutionFilter' is
8083 executed between the execution of `glBegin' and the corresponding
8084 execution of `glEnd'.")
8086 (define-gl-procedures
8087 ((glGetError -> GLenum))
8088 "Return error information.
8090 `glGetError' returns the value of the error flag. Each detectable error
8091 is assigned a numeric code and symbolic name. When an error occurs, the
8092 error flag is set to the appropriate error code value. No other errors
8093 are recorded until `glGetError' is called, the error code is returned,
8094 and the flag is reset to `GL_NO_ERROR'. If a call to `glGetError'
8095 returns `GL_NO_ERROR', there has been no detectable error since the last
8096 call to `glGetError', or since the GL was initialized.
8098 To allow for distributed implementations, there may be several error
8099 flags. If any single error flag has recorded an error, the value of that
8100 flag is returned and that flag is reset to `GL_NO_ERROR' when
8101 `glGetError' is called. If more than one flag has recorded an error,
8102 `glGetError' returns and clears an arbitrary error flag value. Thus,
8103 `glGetError' should always be called in a loop, until it returns
8104 `GL_NO_ERROR', if all error flags are to be reset.
8106 Initially, all error flags are set to `GL_NO_ERROR'.
8108 The following errors are currently defined:
8111 No error has been recorded. The value of this symbolic constant is
8115 An unacceptable value is specified for an enumerated argument. The
8116 offending command is ignored and has no other side effect than to
8120 A numeric argument is out of range. The offending command is
8121 ignored and has no other side effect than to set the error flag.
8123 `GL_INVALID_OPERATION'
8124 The specified operation is not allowed in the current state. The
8125 offending command is ignored and has no other side effect than to
8129 This command would cause a stack overflow. The offending command is
8130 ignored and has no other side effect than to set the error flag.
8132 `GL_STACK_UNDERFLOW'
8133 This command would cause a stack underflow. The offending command
8134 is ignored and has no other side effect than to set the error flag.
8137 There is not enough memory left to execute the command. The state
8138 of the GL is undefined, except for the state of the error flags,
8139 after this error is recorded.
8141 `GL_TABLE_TOO_LARGE'
8142 The specified table exceeds the implementation's maximum supported
8143 table size. The offending command is ignored and has no other side
8144 effect than to set the error flag.
8146 When an error flag is set, results of a GL operation are undefined only
8147 if `GL_OUT_OF_MEMORY' has occurred. In all other cases, the command
8148 generating the error is ignored and has no effect on the GL state or
8149 frame buffer contents. If the generating command returns a value, it
8150 returns 0. If `glGetError' itself generates an error, it returns 0.
8152 `GL_INVALID_OPERATION' is generated if `glGetError' is executed between
8153 the execution of `glBegin' and the corresponding execution of `glEnd'.
8154 In this case, `glGetError' returns 0.")
8156 (define-gl-procedures
8165 "Get histogram table.
8168 Must be `GL_HISTOGRAM'.
8171 If `GL_TRUE', each component counter that is actually returned is
8172 reset to zero. (Other counters are unaffected.) If `GL_FALSE', none
8173 of the counters in the histogram table is modified.
8176 The format of values to be returned in VALUES. Must be one of
8177 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
8178 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8181 The type of values to be returned in VALUES. Symbolic constants
8182 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8183 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8184 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8185 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8186 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8187 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8188 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8189 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8193 A pointer to storage for the returned histogram table.
8195 `glGetHistogram' returns the current histogram table as a
8196 one-dimensional image with the same width as the histogram. No pixel
8197 transfer operations are performed on this image, but pixel storage modes
8198 that are applicable to 1D images are honored.
8200 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8201 target (see `glBindBuffer') while a histogram table is requested, VALUES
8202 is treated as a byte offset into the buffer object's data store.
8204 Color components that are requested in the specified FORMAT, but which
8205 are not included in the internal format of the histogram, are returned
8206 as zero. The assignments of internal color components to the components
8207 requested by FORMAT are:
8209 *Internal Component*
8210 *Resulting Component*
8229 `GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
8231 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8234 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8237 `GL_INVALID_OPERATION' is generated if TYPE is one of
8238 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8239 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8242 `GL_INVALID_OPERATION' is generated if TYPE is one of
8243 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8244 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8245 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8246 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8247 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8249 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8250 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8251 store is currently mapped.
8253 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8254 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8255 to the buffer object such that the memory writes required would exceed
8256 the data store size.
8258 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8259 bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
8260 divisible into the number of bytes needed to store in memory a datum
8263 `GL_INVALID_OPERATION' is generated if `glGetHistogram' is executed
8264 between the execution of `glBegin' and the corresponding execution of
8267 (define-gl-procedures
8276 "Get minimum and maximum pixel values.
8279 Must be `GL_MINMAX'.
8282 If `GL_TRUE', all entries in the minmax table that are actually
8283 returned are reset to their initial values. (Other entries are
8284 unaltered.) If `GL_FALSE', the minmax table is unaltered.
8287 The format of the data to be returned in VALUES. Must be one of
8288 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
8289 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8292 The type of the data to be returned in VALUES. Symbolic constants
8293 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8294 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8295 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8296 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8297 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8298 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8299 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8300 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8304 A pointer to storage for the returned values.
8306 `glGetMinmax' returns the accumulated minimum and maximum pixel values
8307 (computed on a per-component basis) in a one-dimensional image of width
8308 2. The first set of return values are the minima, and the second set of
8309 return values are the maxima. The format of the return values is
8310 determined by FORMAT, and their type is determined by TYPES.
8312 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8313 target (see `glBindBuffer') while minimum and maximum pixel values are
8314 requested, VALUES is treated as a byte offset into the buffer object's
8317 No pixel transfer operations are performed on the return values, but
8318 pixel storage modes that are applicable to one-dimensional images are
8319 performed. Color components that are requested in the specified FORMAT,
8320 but that are not included in the internal format of the minmax table,
8321 are returned as zero. The assignment of internal color components to the
8322 components requested by FORMAT are as follows:
8326 *Internal Component*
8327 *Resulting Component*
8344 If RESET is `GL_TRUE', the minmax table entries corresponding to the
8345 return values are reset to their initial values. Minimum and maximum
8346 values that are not returned are not modified, even if RESET is
8349 `GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
8351 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8354 `GL_INVALID_ENUM' is generated if TYPES is not one of the allowable
8357 `GL_INVALID_OPERATION' is generated if TYPES is one of
8358 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8359 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8362 `GL_INVALID_OPERATION' is generated if TYPES is one of
8363 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8364 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8365 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8366 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8367 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8369 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8370 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8371 store is currently mapped.
8373 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8374 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8375 to the buffer object such that the memory writes required would exceed
8376 the data store size.
8378 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8379 bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
8380 divisible into the number of bytes needed to store in memory a datum
8383 `GL_INVALID_OPERATION' is generated if `glGetMinmax' is executed between
8384 the execution of `glBegin' and the corresponding execution of `glEnd'.")
8386 (define-gl-procedures
8387 ((glGetPolygonStipple (pattern GLubyte-*) -> void))
8388 "Return the polygon stipple pattern.
8391 Returns the stipple pattern. The initial value is all 1's.
8393 `glGetPolygonStipple' returns to PATTERN a 32×32 polygon stipple
8394 pattern. The pattern is packed into memory as if `glReadPixels' with
8395 both HEIGHT and WIDTH of 32, TYPE of `GL_BITMAP', and FORMAT of
8396 `GL_COLOR_INDEX' were called, and the stipple pattern were stored in an
8397 internal 32×32 color index buffer. Unlike `glReadPixels', however, pixel
8398 transfer operations (shift, offset, pixel map) are not applied to the
8399 returned stipple image.
8401 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8402 target (see `glBindBuffer') while a polygon stipple pattern is
8403 requested, PATTERN is treated as a byte offset into the buffer object's
8406 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8407 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8408 store is currently mapped.
8410 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8411 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8412 to the buffer object such that the memory writes required would exceed
8413 the data store size.
8415 `GL_INVALID_OPERATION' is generated if `glGetPolygonStipple' is executed
8416 between the execution of `glBegin' and the corresponding execution of
8419 (define-gl-procedures
8420 ((glGetProgramInfoLog
8427 "Returns the information log for a program object.
8430 Specifies the program object whose information log is to be
8434 Specifies the size of the character buffer for storing the returned
8438 Returns the length of the string returned in INFOLOG (excluding the
8442 Specifies an array of characters that is used to return the
8445 `glGetProgramInfoLog' returns the information log for the specified
8446 program object. The information log for a program object is modified
8447 when the program object is linked or validated. The string that is
8448 returned will be null terminated.
8450 `glGetProgramInfoLog' returns in INFOLOG as much of the information log
8451 as it can, up to a maximum of MAXLENGTH characters. The number of
8452 characters actually returned, excluding the null termination character,
8453 is specified by LENGTH. If the length of the returned string is not
8454 required, a value of `NULL' can be passed in the LENGTH argument. The
8455 size of the buffer required to store the returned information log can be
8456 obtained by calling `glGetProgram' with the value `GL_INFO_LOG_LENGTH'.
8458 The information log for a program object is either an empty string, or a
8459 string containing information about the last link operation, or a string
8460 containing information about the last validation operation. It may
8461 contain diagnostic messages, warning messages, and other information.
8462 When a program object is created, its information log will be a string
8465 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
8468 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
8470 `GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
8472 `GL_INVALID_OPERATION' is generated if `glGetProgramInfoLog' is executed
8473 between the execution of `glBegin' and the corresponding execution of
8476 (define-gl-procedures
8477 ((glGetSeparableFilter
8486 "Get separable convolution filter kernel images.
8489 The separable filter to be retrieved. Must be `GL_SEPARABLE_2D'.
8492 Format of the output images. Must be one of `GL_RED', `GL_GREEN',
8493 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR'`GL_RGBA', `GL_BGRA',
8494 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8497 Data type of components in the output images. Symbolic constants
8498 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8499 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8500 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8501 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8502 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8503 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8504 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8505 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8509 Pointer to storage for the row filter image.
8512 Pointer to storage for the column filter image.
8515 Pointer to storage for the span filter image (currently unused).
8517 `glGetSeparableFilter' returns the two one-dimensional filter kernel
8518 images for the current separable 2D convolution filter. The row image is
8519 placed in ROW and the column image is placed in COLUMN according to the
8520 specifications in FORMAT and TYPE. (In the current implementation, SPAN
8521 is not affected in any way.) No pixel transfer operations are performed
8522 on the images, but the relevant pixel storage modes are applied.
8524 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8525 target (see `glBindBuffer') while a separable convolution filter is
8526 requested, ROW, COLUMN, and SPAN are treated as a byte offset into the
8527 buffer object's data store.
8529 Color components that are present in FORMAT but not included in the
8530 internal format of the filters are returned as zero. The assignments of
8531 internal color components to the components of FORMAT are as follows:
8535 *Internal Component*
8536 *Resulting Component*
8558 `GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
8560 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8563 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8566 `GL_INVALID_OPERATION' is generated if TYPE is one of
8567 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8568 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8571 `GL_INVALID_OPERATION' is generated if TYPE is one of
8572 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8573 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8574 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8575 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8576 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8578 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8579 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8580 store is currently mapped.
8582 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8583 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8584 to the buffer object such that the memory writes required would exceed
8585 the data store size.
8587 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8588 bound to the `GL_PIXEL_PACK_BUFFER' target and ROW or COLUMN is not
8589 evenly divisible into the number of bytes needed to store in memory a
8590 datum indicated by TYPE.
8592 `GL_INVALID_OPERATION' is generated if `glGetSeparableFilter' is
8593 executed between the execution of `glBegin' and the corresponding
8594 execution of `glEnd'.")
8596 (define-gl-procedures
8597 ((glGetShaderInfoLog
8604 "Returns the information log for a shader object.
8607 Specifies the shader object whose information log is to be queried.
8610 Specifies the size of the character buffer for storing the returned
8614 Returns the length of the string returned in INFOLOG (excluding the
8618 Specifies an array of characters that is used to return the
8621 `glGetShaderInfoLog' returns the information log for the specified
8622 shader object. The information log for a shader object is modified when
8623 the shader is compiled. The string that is returned will be null
8626 `glGetShaderInfoLog' returns in INFOLOG as much of the information log
8627 as it can, up to a maximum of MAXLENGTH characters. The number of
8628 characters actually returned, excluding the null termination character,
8629 is specified by LENGTH. If the length of the returned string is not
8630 required, a value of `NULL' can be passed in the LENGTH argument. The
8631 size of the buffer required to store the returned information log can be
8632 obtained by calling `glGetShader' with the value `GL_INFO_LOG_LENGTH'.
8634 The information log for a shader object is a string that may contain
8635 diagnostic messages, warning messages, and other information about the
8636 last compile operation. When a shader object is created, its information
8637 log will be a string of length 0.
8639 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
8642 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
8644 `GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
8646 `GL_INVALID_OPERATION' is generated if `glGetShaderInfoLog' is executed
8647 between the execution of `glBegin' and the corresponding execution of
8650 (define-gl-procedures
8658 "Returns the source code string from a shader object.
8661 Specifies the shader object to be queried.
8664 Specifies the size of the character buffer for storing the returned
8668 Returns the length of the string returned in SOURCE (excluding the
8672 Specifies an array of characters that is used to return the source
8675 `glGetShaderSource' returns the concatenation of the source code strings
8676 from the shader object specified by SHADER. The source code strings for
8677 a shader object are the result of a previous call to `glShaderSource'.
8678 The string returned by the function will be null terminated.
8680 `glGetShaderSource' returns in SOURCE as much of the source code string
8681 as it can, up to a maximum of BUFSIZE characters. The number of
8682 characters actually returned, excluding the null termination character,
8683 is specified by LENGTH. If the length of the returned string is not
8684 required, a value of `NULL' can be passed in the LENGTH argument. The
8685 size of the buffer required to store the returned source code string can
8686 be obtained by calling `glGetShader' with the value
8687 `GL_SHADER_SOURCE_LENGTH'.
8689 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
8692 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
8694 `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.
8696 `GL_INVALID_OPERATION' is generated if `glGetShaderSource' is executed
8697 between the execution of `glBegin' and the corresponding execution of
8700 (define-gl-procedures
8701 ((glGetString (name GLenum) -> const-GLubyte*))
8702 "Return a string describing the current GL connection.
8705 Specifies a symbolic constant, one of `GL_VENDOR', `GL_RENDERER',
8706 `GL_VERSION', `GL_SHADING_LANGUAGE_VERSION', or `GL_EXTENSIONS'.
8708 `glGetString' returns a pointer to a static string describing some
8709 aspect of the current GL connection. NAME can be one of the following:
8714 Returns the company responsible for this GL implementation. This
8715 name does not change from release to release.
8720 Returns the name of the renderer. This name is typically specific
8721 to a particular configuration of a hardware platform. It does not
8722 change from release to release.
8727 Returns a version or release number.
8729 `GL_SHADING_LANGUAGE_VERSION'
8732 Returns a version or release number for the shading language.
8737 Returns a space-separated list of supported extensions to GL.
8739 Because the GL does not include queries for the performance
8740 characteristics of an implementation, some applications are written to
8741 recognize known platforms and modify their GL usage based on known
8742 performance characteristics of these platforms. Strings `GL_VENDOR' and
8743 `GL_RENDERER' together uniquely specify a platform. They do not change
8744 from release to release and should be used by platform-recognition
8747 Some applications want to make use of features that are not part of the
8748 standard GL. These features may be implemented as extensions to the
8749 standard GL. The `GL_EXTENSIONS' string is a space-separated list of
8750 supported GL extensions. (Extension names never contain a space
8753 The `GL_VERSION' and `GL_SHADING_LANGUAGE_VERSION' strings begin with a
8754 version number. The version number uses one of these forms:
8756 MAJOR_NUMBER.MINOR_NUMBERMAJOR_NUMBER.MINOR_NUMBER.RELEASE_NUMBER
8758 Vendor-specific information may follow the version number. Its format
8759 depends on the implementation, but a space always separates the version
8760 number and the vendor-specific information.
8762 All strings are null-terminated.
8764 `GL_INVALID_ENUM' is generated if NAME is not an accepted value.
8766 `GL_INVALID_OPERATION' is generated if `glGetString' is executed between
8767 the execution of `glBegin' and the corresponding execution of `glEnd'.")
8769 (define-gl-procedures
8778 "Return a texture image.
8781 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
8782 `GL_TEXTURE_2D', `GL_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
8783 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
8784 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
8785 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
8788 Specifies the level-of-detail number of the desired image. Level 0
8789 is the base image level. Level N is the N th mipmap reduction
8793 Specifies a pixel format for the returned data. The supported
8794 formats are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
8795 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
8796 `GL_LUMINANCE_ALPHA'.
8799 Specifies a pixel type for the returned data. The supported types
8800 are `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
8801 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
8802 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
8803 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
8804 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
8805 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
8806 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
8807 `GL_UNSIGNED_INT_2_10_10_10_REV'.
8810 Returns the texture image. Should be a pointer to an array of the
8811 type specified by TYPE.
8813 `glGetTexImage' returns a texture image into IMG. TARGET specifies
8814 whether the desired texture image is one specified by `glTexImage1D'
8815 (`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
8816 `GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LEVEL
8817 specifies the level-of-detail number of the desired image. FORMAT and
8818 TYPE specify the format and type of the desired image array. See the
8819 reference pages `glTexImage1D' and `glDrawPixels' for a description of
8820 the acceptable values for the FORMAT and TYPE parameters, respectively.
8822 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8823 target (see `glBindBuffer') while a texture image is requested, IMG is
8824 treated as a byte offset into the buffer object's data store.
8826 To understand the operation of `glGetTexImage', consider the selected
8827 internal four-component texture image to be an RGBA color buffer the
8828 size of the image. The semantics of `glGetTexImage' are then identical
8829 to those of `glReadPixels', with the exception that no pixel transfer
8830 operations are performed, when called with the same FORMAT and TYPE,
8831 with X and Y set to 0, WIDTH set to the width of the texture image
8832 (including border if one was specified), and HEIGHT set to 1 for 1D
8833 images, or to the height of the texture image (including border if one
8834 was specified) for 2D images. Because the internal texture image is an
8835 RGBA image, pixel formats `GL_COLOR_INDEX', `GL_STENCIL_INDEX', and
8836 `GL_DEPTH_COMPONENT' are not accepted, and pixel type `GL_BITMAP' is not
8839 If the selected texture image does not contain four components, the
8840 following mappings are applied. Single-component textures are treated as
8841 RGBA buffers with red set to the single-component value, green set to 0,
8842 blue set to 0, and alpha set to 1. Two-component textures are treated as
8843 RGBA buffers with red set to the value of component zero, alpha set to
8844 the value of component one, and green and blue set to 0. Finally,
8845 three-component textures are treated as RGBA buffers with red set to
8846 component zero, green set to component one, blue set to component two,
8849 To determine the required size of IMG, use `glGetTexLevelParameter' to
8850 determine the dimensions of the internal texture image, then scale the
8851 required number of pixels by the storage required for each pixel, based
8852 on FORMAT and TYPE. Be sure to take the pixel storage parameters into
8853 account, especially `GL_PACK_ALIGNMENT'.
8855 `GL_INVALID_ENUM' is generated if TARGET, FORMAT, or TYPE is not an
8858 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
8860 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
8861 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
8863 `GL_INVALID_OPERATION' is returned if TYPE is one of
8864 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8865 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8868 `GL_INVALID_OPERATION' is returned if TYPE is one of
8869 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8870 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8871 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8872 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV', and
8873 FORMAT is neither `GL_RGBA' or `GL_BGRA'.
8875 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8876 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8877 store is currently mapped.
8879 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8880 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8881 to the buffer object such that the memory writes required would exceed
8882 the data store size.
8884 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8885 bound to the `GL_PIXEL_PACK_BUFFER' target and IMG is not evenly
8886 divisible into the number of bytes needed to store in memory a datum
8889 `GL_INVALID_OPERATION' is generated if `glGetTexImage' is executed
8890 between the execution of `glBegin' and the corresponding execution of
8893 (define-gl-procedures
8894 ((glGetUniformLocation
8896 (name const-GLchar-*)
8899 "Returns the location of a uniform variable.
8902 Specifies the program object to be queried.
8905 Points to a null terminated string containing the name of the
8906 uniform variable whose location is to be queried.
8908 `glGetUniformLocation ' returns an integer that represents the location
8909 of a specific uniform variable within a program object. NAME must be a
8910 null terminated string that contains no white space. NAME must be an
8911 active uniform variable name in PROGRAM that is not a structure, an
8912 array of structures, or a subcomponent of a vector or a matrix. This
8913 function returns -1 if NAME does not correspond to an active uniform
8914 variable in PROGRAM or if NAME starts with the reserved prefix \"gl_\".
8916 Uniform variables that are structures or arrays of structures may be
8917 queried by calling `glGetUniformLocation' for each field within the
8918 structure. The array element operator \"[]\" and the structure field
8919 operator \".\" may be used in NAME in order to select elements within an
8920 array or fields within a structure. The result of using these operators
8921 is not allowed to be another structure, an array of structures, or a
8922 subcomponent of a vector or a matrix. Except if the last part of NAME
8923 indicates a uniform variable array, the location of the first element of
8924 an array can be retrieved by using the name of the array, or by using
8925 the name appended by \"[0]\".
8927 The actual locations assigned to uniform variables are not known until
8928 the program object is linked successfully. After linking has occurred,
8929 the command `glGetUniformLocation' can be used to obtain the location of
8930 a uniform variable. This location value can then be passed to
8931 `glUniform' to set the value of the uniform variable or to
8932 `glGetUniform' in order to query the current value of the uniform
8933 variable. After a program object has been linked successfully, the index
8934 values for uniform variables remain fixed until the next link command
8935 occurs. Uniform variable locations and values can only be queried after
8936 a link if the link was successful.
8938 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
8941 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
8943 `GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
8946 `GL_INVALID_OPERATION' is generated if `glGetUniformLocation' is
8947 executed between the execution of `glBegin' and the corresponding
8948 execution of `glEnd'.")
8950 (define-gl-procedures
8951 ((glHint (target GLenum) (mode GLenum) -> void))
8952 "Specify implementation-specific hints.
8955 Specifies a symbolic constant indicating the behavior to be
8956 controlled. `GL_FOG_HINT', `GL_GENERATE_MIPMAP_HINT',
8957 `GL_LINE_SMOOTH_HINT', `GL_PERSPECTIVE_CORRECTION_HINT',
8958 `GL_POINT_SMOOTH_HINT', `GL_POLYGON_SMOOTH_HINT',
8959 `GL_TEXTURE_COMPRESSION_HINT', and
8960 `GL_FRAGMENT_SHADER_DERIVATIVE_HINT' are accepted.
8963 Specifies a symbolic constant indicating the desired behavior.
8964 `GL_FASTEST', `GL_NICEST', and `GL_DONT_CARE' are accepted.
8966 Certain aspects of GL behavior, when there is room for interpretation,
8967 can be controlled with hints. A hint is specified with two arguments.
8968 TARGET is a symbolic constant indicating the behavior to be controlled,
8969 and MODE is another symbolic constant indicating the desired behavior.
8970 The initial value for each TARGET is `GL_DONT_CARE'. MODE can be one of
8976 The most efficient option should be chosen.
8981 The most correct, or highest quality, option should be chosen.
8988 Though the implementation aspects that can be hinted are well defined,
8989 the interpretation of the hints depends on the implementation. The hint
8990 aspects that can be specified with TARGET, along with suggested
8991 semantics, are as follows:
8996 Indicates the accuracy of fog calculation. If per-pixel fog
8997 calculation is not efficiently supported by the GL implementation,
8998 hinting `GL_DONT_CARE' or `GL_FASTEST' can result in per-vertex
8999 calculation of fog effects.
9001 `GL_FRAGMENT_SHADER_DERIVATIVE_HINT'
9004 Indicates the accuracy of the derivative calculation for the GL
9005 shading language fragment processing built-in functions: `dFdx',
9006 `dFdy', and `fwidth'.
9008 `GL_GENERATE_MIPMAP_HINT'
9011 Indicates the quality of filtering when generating mipmap images.
9013 `GL_LINE_SMOOTH_HINT'
9016 Indicates the sampling quality of antialiased lines. If a larger
9017 filter function is applied, hinting `GL_NICEST' can result in more
9018 pixel fragments being generated during rasterization.
9020 `GL_PERSPECTIVE_CORRECTION_HINT'
9023 Indicates the quality of color, texture coordinate, and fog
9024 coordinate interpolation. If perspective-corrected parameter
9025 interpolation is not efficiently supported by the GL
9026 implementation, hinting `GL_DONT_CARE' or `GL_FASTEST' can result
9027 in simple linear interpolation of colors and/or texture
9030 `GL_POINT_SMOOTH_HINT'
9033 Indicates the sampling quality of antialiased points. If a larger
9034 filter function is applied, hinting `GL_NICEST' can result in more
9035 pixel fragments being generated during rasterization.
9037 `GL_POLYGON_SMOOTH_HINT'
9040 Indicates the sampling quality of antialiased polygons. Hinting
9041 `GL_NICEST' can result in more pixel fragments being generated
9042 during rasterization, if a larger filter function is applied.
9044 `GL_TEXTURE_COMPRESSION_HINT'
9047 Indicates the quality and performance of the compressing texture
9048 images. Hinting `GL_FASTEST' indicates that texture images should
9049 be compressed as quickly as possible, while `GL_NICEST' indicates
9050 that texture images should be compressed with as little image
9051 quality loss as possible. `GL_NICEST' should be selected if the
9052 texture is to be retrieved by `glGetCompressedTexImage' for reuse.
9054 `GL_INVALID_ENUM' is generated if either TARGET or MODE is not an
9057 `GL_INVALID_OPERATION' is generated if `glHint' is executed between the
9058 execution of `glBegin' and the corresponding execution of `glEnd'.")
9060 (define-gl-procedures
9064 (internalformat GLenum)
9068 "Define histogram table.
9071 The histogram whose parameters are to be set. Must be one of
9072 `GL_HISTOGRAM' or `GL_PROXY_HISTOGRAM'.
9075 The number of entries in the histogram table. Must be a power of 2.
9078 The format of entries in the histogram table. Must be one of
9079 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
9080 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
9081 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
9082 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
9083 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
9084 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
9085 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
9086 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
9087 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
9090 If `GL_TRUE', pixels will be consumed by the histogramming process
9091 and no drawing or texture loading will take place. If `GL_FALSE',
9092 pixels will proceed to the minmax process after histogramming.
9094 When `GL_HISTOGRAM' is enabled, RGBA color components are converted to
9095 histogram table indices by clamping to the range [0,1], multiplying by
9096 the width of the histogram table, and rounding to the nearest integer.
9097 The table entries selected by the RGBA indices are then incremented. (If
9098 the internal format of the histogram table includes luminance, then the
9099 index derived from the R color component determines the luminance table
9100 entry to be incremented.) If a histogram table entry is incremented
9101 beyond its maximum value, then its value becomes undefined. (This is not
9104 Histogramming is performed only for RGBA pixels (though these may be
9105 specified originally as color indices and converted to RGBA by index
9106 table lookup). Histogramming is enabled with `glEnable' and disabled
9109 When TARGET is `GL_HISTOGRAM', `glHistogram' redefines the current
9110 histogram table to have WIDTH entries of the format specified by
9111 INTERNALFORMAT. The entries are indexed 0 through WIDTH-1 , and all
9112 entries are initialized to zero. The values in the previous histogram
9113 table, if any, are lost. If SINK is `GL_TRUE', then pixels are discarded
9114 after histogramming; no further processing of the pixels takes place,
9115 and no drawing, texture loading, or pixel readback will result.
9117 When TARGET is `GL_PROXY_HISTOGRAM', `glHistogram' computes all state
9118 information as if the histogram table were to be redefined, but does not
9119 actually define the new table. If the requested histogram table is too
9120 large to be supported, then the state information will be set to zero.
9121 This provides a way to determine if a histogram table with the given
9122 parameters can be supported.
9126 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
9129 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or is not a
9132 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
9135 `GL_TABLE_TOO_LARGE' is generated if TARGET is `GL_HISTOGRAM' and the
9136 histogram table specified is too large for the implementation.
9138 `GL_INVALID_OPERATION' is generated if `glHistogram' is executed between
9139 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9141 (define-gl-procedures
9142 ((glIndexMask (mask GLuint) -> void))
9143 "Control the writing of individual bits in the color index buffers.
9146 Specifies a bit mask to enable and disable the writing of
9147 individual bits in the color index buffers. Initially, the mask is
9150 `glIndexMask' controls the writing of individual bits in the color index
9151 buffers. The least significant N bits of MASK, where N is the number of
9152 bits in a color index buffer, specify a mask. Where a 1 (one) appears in
9153 the mask, it's possible to write to the corresponding bit in the color
9154 index buffer (or buffers). Where a 0 (zero) appears, the corresponding
9155 bit is write-protected.
9157 This mask is used only in color index mode, and it affects only the
9158 buffers currently selected for writing (see `glDrawBuffer'). Initially,
9159 all bits are enabled for writing.
9161 `GL_INVALID_OPERATION' is generated if `glIndexMask' is executed between
9162 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9164 (define-gl-procedures
9168 (pointer const-GLvoid-*)
9171 "Define an array of color indexes.
9174 Specifies the data type of each color index in the array. Symbolic
9175 constants `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
9176 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
9179 Specifies the byte offset between consecutive color indexes. If
9180 STRIDE is 0, the color indexes are understood to be tightly packed
9181 in the array. The initial value is 0.
9184 Specifies a pointer to the first index in the array. The initial
9187 `glIndexPointer' specifies the location and data format of an array of
9188 color indexes to use when rendering. TYPE specifies the data type of
9189 each color index and STRIDE specifies the byte stride from one color
9190 index to the next, allowing vertices and attributes to be packed into a
9191 single array or stored in separate arrays.
9193 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
9194 target (see `glBindBuffer') while a color index array is specified,
9195 POINTER is treated as a byte offset into the buffer object's data store.
9196 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
9197 color index vertex array client-side state
9198 (`GL_INDEX_ARRAY_BUFFER_BINDING').
9200 When a color index array is specified, TYPE, STRIDE, and POINTER are
9201 saved as client-side state, in addition to the current vertex array
9202 buffer object binding.
9204 To enable and disable the color index array, call `glEnableClientState'
9205 and `glDisableClientState' with the argument `GL_INDEX_ARRAY'. If
9206 enabled, the color index array is used when `glDrawArrays',
9207 `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
9208 `glDrawRangeElements', or `glArrayElement' is called.
9210 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
9212 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
9214 (define-gl-procedures
9215 ((glIndexi (c GLint) -> void)
9216 (glIndexf (c GLfloat) -> void)
9217 (glIndexub (c GLubyte) -> void))
9218 "Set the current color index.
9221 Specifies the new value for the current color index.
9225 `glIndex' updates the current (single-valued) color index. It takes one
9226 argument, the new value for the current color index.
9228 The current index is stored as a floating-point value. Integer values
9229 are converted directly to floating-point values, with no special
9230 mapping. The initial value is 1.
9232 Index values outside the representable range of the color index buffer
9233 are not clamped. However, before an index is dithered (if enabled) and
9234 written to the frame buffer, it is converted to fixed-point format. Any
9235 bits in the integer portion of the resulting fixed-point value that do
9236 not correspond to bits in the frame buffer are masked out.")
9238 (define-gl-procedures
9239 ((glInitNames -> void))
9240 "Initialize the name stack.
9242 The name stack is used during selection mode to allow sets of rendering
9243 commands to be uniquely identified. It consists of an ordered set of
9244 unsigned integers. `glInitNames' causes the name stack to be initialized
9245 to its default empty state.
9247 The name stack is always empty while the render mode is not `GL_SELECT'.
9248 Calls to `glInitNames' while the render mode is not `GL_SELECT' are
9251 `GL_INVALID_OPERATION' is generated if `glInitNames' is executed between
9252 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9254 (define-gl-procedures
9255 ((glInterleavedArrays
9258 (pointer const-GLvoid-*)
9261 "Simultaneously specify and enable several interleaved arrays.
9264 Specifies the type of array to enable. Symbolic constants `GL_V2F',
9265 `GL_V3F', `GL_C4UB_V2F', `GL_C4UB_V3F', `GL_C3F_V3F', `GL_N3F_V3F',
9266 `GL_C4F_N3F_V3F', `GL_T2F_V3F', `GL_T4F_V4F', `GL_T2F_C4UB_V3F',
9267 `GL_T2F_C3F_V3F', `GL_T2F_N3F_V3F', `GL_T2F_C4F_N3F_V3F', and
9268 `GL_T4F_C4F_N3F_V4F' are accepted.
9271 Specifies the offset in bytes between each aggregate array element.
9273 `glInterleavedArrays' lets you specify and enable individual color,
9274 normal, texture and vertex arrays whose elements are part of a larger
9275 aggregate array element. For some implementations, this is more
9276 efficient than specifying the arrays separately.
9278 If STRIDE is 0, the aggregate elements are stored consecutively.
9279 Otherwise, STRIDE bytes occur between the beginning of one aggregate
9280 array element and the beginning of the next aggregate array element.
9282 FORMAT serves as a ``key'' describing the extraction of individual
9283 arrays from the aggregate array. If FORMAT contains a T, then texture
9284 coordinates are extracted from the interleaved array. If C is present,
9285 color values are extracted. If N is present, normal coordinates are
9286 extracted. Vertex coordinates are always extracted.
9288 The digits 2, 3, and 4 denote how many values are extracted. F indicates
9289 that values are extracted as floating-point values. Colors may also be
9290 extracted as 4 unsigned bytes if 4UB follows the C. If a color is
9291 extracted as 4 unsigned bytes, the vertex array element which follows is
9292 located at the first possible floating-point aligned address.
9294 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted value.
9296 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
9298 (define-gl-procedures
9299 ((glIsBuffer (buffer GLuint) -> GLboolean))
9300 "Determine if a name corresponds to a buffer object.
9303 Specifies a value that may be the name of a buffer object.
9305 `glIsBuffer' returns `GL_TRUE' if BUFFER is currently the name of a
9306 buffer object. If BUFFER is zero, or is a non-zero value that is not
9307 currently the name of a buffer object, or if an error occurs,
9308 `glIsBuffer' returns `GL_FALSE'.
9310 A name returned by `glGenBuffers', but not yet associated with a buffer
9311 object by calling `glBindBuffer', is not the name of a buffer object.
9313 `GL_INVALID_OPERATION' is generated if `glIsBuffer' is executed between
9314 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9316 (define-gl-procedures
9317 ((glIsEnabled (cap GLenum) -> GLboolean))
9318 "Test whether a capability is enabled.
9321 Specifies a symbolic constant indicating a GL capability.
9323 `glIsEnabled' returns `GL_TRUE' if CAP is an enabled capability and
9324 returns `GL_FALSE' otherwise. Initially all capabilities except
9325 `GL_DITHER' are disabled; `GL_DITHER' is initially enabled.
9327 The following capabilities are accepted for CAP:
9341 `glBlendFunc', `glLogicOp'
9362 `glConvolutionFilter1D'
9365 `glConvolutionFilter2D'
9371 `glDepthFunc', `glDepthRange'
9376 `GL_EDGE_FLAG_ARRAY'
9382 `GL_FOG_COORD_ARRAY'
9395 `glLightModel', `glLight'
9398 `glMaterial', `glLightModel', `glLight'
9415 `GL_MAP1_TEXTURE_COORD_1'
9418 `GL_MAP1_TEXTURE_COORD_2'
9421 `GL_MAP1_TEXTURE_COORD_3'
9424 `GL_MAP1_TEXTURE_COORD_4'
9436 `GL_MAP2_TEXTURE_COORD_1'
9439 `GL_MAP2_TEXTURE_COORD_2'
9442 `GL_MAP2_TEXTURE_COORD_3'
9445 `GL_MAP2_TEXTURE_COORD_4'
9475 `GL_POLYGON_OFFSET_FILL'
9478 `GL_POLYGON_OFFSET_LINE'
9481 `GL_POLYGON_OFFSET_POINT'
9484 `GL_POLYGON_STIPPLE'
9487 `GL_POST_COLOR_MATRIX_COLOR_TABLE'
9490 `GL_POST_CONVOLUTION_COLOR_TABLE'
9496 `GL_SAMPLE_ALPHA_TO_COVERAGE'
9499 `GL_SAMPLE_ALPHA_TO_ONE'
9502 `GL_SAMPLE_COVERAGE'
9508 `GL_SECONDARY_COLOR_ARRAY'
9509 `glSecondaryColorPointer'
9512 `glSeparableFilter2D'
9515 `glStencilFunc', `glStencilOp'
9526 `GL_TEXTURE_COORD_ARRAY'
9529 `GL_TEXTURE_CUBE_MAP'
9547 `GL_VERTEX_PROGRAM_POINT_SIZE'
9550 `GL_VERTEX_PROGRAM_TWO_SIDE'
9555 `GL_INVALID_ENUM' is generated if CAP is not an accepted value.
9557 `GL_INVALID_OPERATION' is generated if `glIsEnabled' is executed between
9558 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9560 (define-gl-procedures
9561 ((glIsList (list GLuint) -> GLboolean))
9562 "Determine if a name corresponds to a display list.
9565 Specifies a potential display list name.
9567 `glIsList' returns `GL_TRUE' if LIST is the name of a display list and
9568 returns `GL_FALSE' if it is not, or if an error occurs.
9570 A name returned by `glGenLists', but not yet associated with a display
9571 list by calling `glNewList', is not the name of a display list.
9573 `GL_INVALID_OPERATION' is generated if `glIsList' is executed between
9574 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9576 (define-gl-procedures
9577 ((glIsProgram (program GLuint) -> GLboolean))
9578 "Determines if a name corresponds to a program object.
9581 Specifies a potential program object.
9583 `glIsProgram' returns `GL_TRUE' if PROGRAM is the name of a program
9584 object previously created with `glCreateProgram' and not yet deleted
9585 with `glDeleteProgram'. If PROGRAM is zero or a non-zero value that is
9586 not the name of a program object, or if an error occurs, `glIsProgram'
9589 `GL_INVALID_OPERATION' is generated if `glIsProgram' is executed between
9590 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9592 (define-gl-procedures
9593 ((glIsQuery (id GLuint) -> GLboolean))
9594 "Determine if a name corresponds to a query object.
9597 Specifies a value that may be the name of a query object.
9599 `glIsQuery' returns `GL_TRUE' if ID is currently the name of a query
9600 object. If ID is zero, or is a non-zero value that is not currently the
9601 name of a query object, or if an error occurs, `glIsQuery' returns
9604 A name returned by `glGenQueries', but not yet associated with a query
9605 object by calling `glBeginQuery', is not the name of a query object.
9607 `GL_INVALID_OPERATION' is generated if `glIsQuery' is executed between
9608 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9610 (define-gl-procedures
9611 ((glIsShader (shader GLuint) -> GLboolean))
9612 "Determines if a name corresponds to a shader object.
9615 Specifies a potential shader object.
9617 `glIsShader' returns `GL_TRUE' if SHADER is the name of a shader object
9618 previously created with `glCreateShader' and not yet deleted with
9619 `glDeleteShader'. If SHADER is zero or a non-zero value that is not the
9620 name of a shader object, or if an error occurs, `glIsShader ' returns
9623 `GL_INVALID_OPERATION' is generated if `glIsShader' is executed between
9624 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9626 (define-gl-procedures
9627 ((glIsTexture (texture GLuint) -> GLboolean))
9628 "Determine if a name corresponds to a texture.
9631 Specifies a value that may be the name of a texture.
9633 `glIsTexture' returns `GL_TRUE' if TEXTURE is currently the name of a
9634 texture. If TEXTURE is zero, or is a non-zero value that is not
9635 currently the name of a texture, or if an error occurs, `glIsTexture'
9638 A name returned by `glGenTextures', but not yet associated with a
9639 texture by calling `glBindTexture', is not the name of a texture.
9641 `GL_INVALID_OPERATION' is generated if `glIsTexture' is executed between
9642 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9644 (define-gl-procedures
9655 "Set the lighting model parameters.
9658 Specifies a single-valued lighting model parameter.
9659 `GL_LIGHT_MODEL_LOCAL_VIEWER', `GL_LIGHT_MODEL_COLOR_CONTROL', and
9660 `GL_LIGHT_MODEL_TWO_SIDE' are accepted.
9663 Specifies the value that PARAM will be set to.
9665 `glLightModel' sets the lighting model parameter. PNAME names a
9666 parameter and PARAMS gives the new value. There are three lighting model
9669 `GL_LIGHT_MODEL_AMBIENT'
9672 PARAMS contains four integer or floating-point values that specify
9673 the ambient RGBA intensity of the entire scene. Integer values are
9674 mapped linearly such that the most positive representable value
9675 maps to 1.0, and the most negative representable value maps to -1.0
9676 . Floating-point values are mapped directly. Neither integer nor
9677 floating-point values are clamped. The initial ambient scene
9678 intensity is (0.2, 0.2, 0.2, 1.0).
9680 `GL_LIGHT_MODEL_COLOR_CONTROL'
9683 PARAMS must be either `GL_SEPARATE_SPECULAR_COLOR' or
9684 `GL_SINGLE_COLOR'. `GL_SINGLE_COLOR' specifies that a single color
9685 is generated from the lighting computation for a vertex.
9686 `GL_SEPARATE_SPECULAR_COLOR' specifies that the specular color
9687 computation of lighting be stored separately from the remainder of
9688 the lighting computation. The specular color is summed into the
9689 generated fragment's color after the application of texture mapping
9690 (if enabled). The initial value is `GL_SINGLE_COLOR'.
9692 `GL_LIGHT_MODEL_LOCAL_VIEWER'
9695 PARAMS is a single integer or floating-point value that specifies
9696 how specular reflection angles are computed. If PARAMS is 0 (or
9697 0.0), specular reflection angles take the view direction to be
9698 parallel to and in the direction of the -Z axis, regardless of the
9699 location of the vertex in eye coordinates. Otherwise, specular
9700 reflections are computed from the origin of the eye coordinate
9701 system. The initial value is 0.
9703 `GL_LIGHT_MODEL_TWO_SIDE'
9706 PARAMS is a single integer or floating-point value that specifies
9707 whether one- or two-sided lighting calculations are done for
9708 polygons. It has no effect on the lighting calculations for points,
9709 lines, or bitmaps. If PARAMS is 0 (or 0.0), one-sided lighting is
9710 specified, and only the FRONT material parameters are used in the
9711 lighting equation. Otherwise, two-sided lighting is specified. In
9712 this case, vertices of back-facing polygons are lighted using the
9713 BACK material parameters and have their normals reversed before the
9714 lighting equation is evaluated. Vertices of front-facing polygons
9715 are always lighted using the FRONT material parameters, with no
9716 change to their normals. The initial value is 0.
9718 In RGBA mode, the lighted color of a vertex is the sum of the material
9719 emission intensity, the product of the material ambient reflectance and
9720 the lighting model full-scene ambient intensity, and the contribution of
9721 each enabled light source. Each light source contributes the sum of
9722 three terms: ambient, diffuse, and specular. The ambient light source
9723 contribution is the product of the material ambient reflectance and the
9724 light's ambient intensity. The diffuse light source contribution is the
9725 product of the material diffuse reflectance, the light's diffuse
9726 intensity, and the dot product of the vertex's normal with the
9727 normalized vector from the vertex to the light source. The specular
9728 light source contribution is the product of the material specular
9729 reflectance, the light's specular intensity, and the dot product of the
9730 normalized vertex-to-eye and vertex-to-light vectors, raised to the
9731 power of the shininess of the material. All three light source
9732 contributions are attenuated equally based on the distance from the
9733 vertex to the light source and on light source direction, spread
9734 exponent, and spread cutoff angle. All dot products are replaced with 0
9735 if they evaluate to a negative value.
9737 The alpha component of the resulting lighted color is set to the alpha
9738 value of the material diffuse reflectance.
9740 In color index mode, the value of the lighted index of a vertex ranges
9741 from the ambient to the specular values passed to `glMaterial' using
9742 `GL_COLOR_INDEXES'. Diffuse and specular coefficients, computed with a
9743 (.30, .59, .11) weighting of the lights' colors, the shininess of the
9744 material, and the same reflection and attenuation equations as in the
9745 RGBA case, determine how much above ambient the resulting index is.
9747 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
9749 `GL_INVALID_ENUM' is generated if PNAME is
9750 `GL_LIGHT_MODEL_COLOR_CONTROL' and PARAMS is not one of
9751 `GL_SINGLE_COLOR' or `GL_SEPARATE_SPECULAR_COLOR'.
9753 `GL_INVALID_OPERATION' is generated if `glLightModel' is executed
9754 between the execution of `glBegin' and the corresponding execution of
9757 (define-gl-procedures
9770 "Set light source parameters.
9773 Specifies a light. The number of lights depends on the
9774 implementation, but at least eight lights are supported. They are
9775 identified by symbolic names of the form `GL_LIGHT' I , where i
9776 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
9779 Specifies a single-valued light source parameter for LIGHT.
9780 `GL_SPOT_EXPONENT', `GL_SPOT_CUTOFF', `GL_CONSTANT_ATTENUATION',
9781 `GL_LINEAR_ATTENUATION', and `GL_QUADRATIC_ATTENUATION' are
9785 Specifies the value that parameter PNAME of light source LIGHT will
9788 `glLight' sets the values of individual light source parameters. LIGHT
9789 names the light and is a symbolic name of the form `GL_LIGHT'I , where i
9790 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1. PNAME specifies one
9791 of ten light source parameters, again by symbolic name. PARAMS is either
9792 a single value or a pointer to an array that contains the new values.
9794 To enable and disable lighting calculation, call `glEnable' and
9795 `glDisable' with argument `GL_LIGHTING'. Lighting is initially disabled.
9796 When it is enabled, light sources that are enabled contribute to the
9797 lighting calculation. Light source I is enabled and disabled using
9798 `glEnable' and `glDisable' with argument `GL_LIGHT'I .
9800 The ten light parameters are as follows:
9803 PARAMS contains four integer or floating-point values that specify
9804 the ambient RGBA intensity of the light. Integer values are mapped
9805 linearly such that the most positive representable value maps to
9806 1.0, and the most negative representable value maps to -1.0 .
9807 Floating-point values are mapped directly. Neither integer nor
9808 floating-point values are clamped. The initial ambient light
9809 intensity is (0, 0, 0, 1).
9812 PARAMS contains four integer or floating-point values that specify
9813 the diffuse RGBA intensity of the light. Integer values are mapped
9814 linearly such that the most positive representable value maps to
9815 1.0, and the most negative representable value maps to -1.0 .
9816 Floating-point values are mapped directly. Neither integer nor
9817 floating-point values are clamped. The initial value for
9818 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
9822 PARAMS contains four integer or floating-point values that specify
9823 the specular RGBA intensity of the light. Integer values are mapped
9824 linearly such that the most positive representable value maps to
9825 1.0, and the most negative representable value maps to -1.0 .
9826 Floating-point values are mapped directly. Neither integer nor
9827 floating-point values are clamped. The initial value for
9828 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
9832 PARAMS contains four integer or floating-point values that specify
9833 the position of the light in homogeneous object coordinates. Both
9834 integer and floating-point values are mapped directly. Neither
9835 integer nor floating-point values are clamped.
9837 The position is transformed by the modelview matrix when `glLight'
9838 is called (just as if it were a point), and it is stored in eye
9839 coordinates. If the W component of the position is 0, the light is
9840 treated as a directional source. Diffuse and specular lighting
9841 calculations take the light's direction, but not its actual
9842 position, into account, and attenuation is disabled. Otherwise,
9843 diffuse and specular lighting calculations are based on the actual
9844 location of the light in eye coordinates, and attenuation is
9845 enabled. The initial position is (0, 0, 1, 0); thus, the initial
9846 light source is directional, parallel to, and in the direction of
9850 PARAMS contains three integer or floating-point values that specify
9851 the direction of the light in homogeneous object coordinates. Both
9852 integer and floating-point values are mapped directly. Neither
9853 integer nor floating-point values are clamped.
9855 The spot direction is transformed by the upper 3x3 of the modelview
9856 matrix when `glLight' is called, and it is stored in eye
9857 coordinates. It is significant only when `GL_SPOT_CUTOFF' is not
9858 180, which it is initially. The initial direction is (0,0-1) .
9861 PARAMS is a single integer or floating-point value that specifies
9862 the intensity distribution of the light. Integer and floating-point
9863 values are mapped directly. Only values in the range [0,128] are
9866 Effective light intensity is attenuated by the cosine of the angle
9867 between the direction of the light and the direction from the light
9868 to the vertex being lighted, raised to the power of the spot
9869 exponent. Thus, higher spot exponents result in a more focused
9870 light source, regardless of the spot cutoff angle (see
9871 `GL_SPOT_CUTOFF', next paragraph). The initial spot exponent is 0,
9872 resulting in uniform light distribution.
9875 PARAMS is a single integer or floating-point value that specifies
9876 the maximum spread angle of a light source. Integer and
9877 floating-point values are mapped directly. Only values in the range
9878 [0,90] and the special value 180 are accepted. If the angle between
9879 the direction of the light and the direction from the light to the
9880 vertex being lighted is greater than the spot cutoff angle, the
9881 light is completely masked. Otherwise, its intensity is controlled
9882 by the spot exponent and the attenuation factors. The initial spot
9883 cutoff is 180, resulting in uniform light distribution.
9885 `GL_CONSTANT_ATTENUATION'
9886 `GL_LINEAR_ATTENUATION'
9887 `GL_QUADRATIC_ATTENUATION'
9888 PARAMS is a single integer or floating-point value that specifies
9889 one of the three light attenuation factors. Integer and
9890 floating-point values are mapped directly. Only nonnegative values
9891 are accepted. If the light is positional, rather than directional,
9892 its intensity is attenuated by the reciprocal of the sum of the
9893 constant factor, the linear factor times the distance between the
9894 light and the vertex being lighted, and the quadratic factor times
9895 the square of the same distance. The initial attenuation factors
9896 are (1, 0, 0), resulting in no attenuation.
9898 `GL_INVALID_ENUM' is generated if either LIGHT or PNAME is not an
9901 `GL_INVALID_VALUE' is generated if a spot exponent value is specified
9902 outside the range [0,128] , or if spot cutoff is specified outside the
9903 range [0,90] (except for the special value 180), or if a negative
9904 attenuation factor is specified.
9906 `GL_INVALID_OPERATION' is generated if `glLight' is executed between the
9907 execution of `glBegin' and the corresponding execution of `glEnd'.")
9909 (define-gl-procedures
9915 "Specify the line stipple pattern.
9918 Specifies a multiplier for each bit in the line stipple pattern. If
9919 FACTOR is 3, for example, each bit in the pattern is used three
9920 times before the next bit in the pattern is used. FACTOR is clamped
9921 to the range [1, 256] and defaults to 1.
9924 Specifies a 16-bit integer whose bit pattern determines which
9925 fragments of a line will be drawn when the line is rasterized. Bit
9926 zero is used first; the default pattern is all 1's.
9928 Line stippling masks out certain fragments produced by rasterization;
9929 those fragments will not be drawn. The masking is achieved by using
9930 three parameters: the 16-bit line stipple pattern PATTERN, the repeat
9931 count FACTOR, and an integer stipple counter S .
9933 Counter S is reset to 0 whenever `glBegin' is called and before each
9934 line segment of a `glBegin'(`GL_LINES')/`glEnd' sequence is generated.
9935 It is incremented after each fragment of a unit width aliased line
9936 segment is generated or after each I fragments of an I width line
9937 segment are generated. The I fragments associated with count S are
9940 PATTERN bit (S/FACTOR,)%16
9942 is 0, otherwise these fragments are sent to the frame buffer. Bit zero
9943 of PATTERN is the least significant bit.
9945 Antialiased lines are treated as a sequence of 1×WIDTH rectangles for
9946 purposes of stippling. Whether rectangle S is rasterized or not depends
9947 on the fragment rule described for aliased lines, counting rectangles
9948 rather than groups of fragments.
9950 To enable and disable line stippling, call `glEnable' and `glDisable'
9951 with argument `GL_LINE_STIPPLE'. When enabled, the line stipple pattern
9952 is applied as described above. When disabled, it is as if the pattern
9953 were all 1's. Initially, line stippling is disabled.
9955 `GL_INVALID_OPERATION' is generated if `glLineStipple' is executed
9956 between the execution of `glBegin' and the corresponding execution of
9959 (define-gl-procedures
9960 ((glLineWidth (width GLfloat) -> void))
9961 "Specify the width of rasterized lines.
9964 Specifies the width of rasterized lines. The initial value is 1.
9966 `glLineWidth' specifies the rasterized width of both aliased and
9967 antialiased lines. Using a line width other than 1 has different
9968 effects, depending on whether line antialiasing is enabled. To enable
9969 and disable line antialiasing, call `glEnable' and `glDisable' with
9970 argument `GL_LINE_SMOOTH'. Line antialiasing is initially disabled.
9972 If line antialiasing is disabled, the actual width is determined by
9973 rounding the supplied width to the nearest integer. (If the rounding
9974 results in the value 0, it is as if the line width were 1.) If
9975 ∣ΔX,∣>=∣ΔY,∣ , I pixels are filled in each column that is rasterized,
9976 where I is the rounded value of WIDTH. Otherwise, I pixels are filled in
9977 each row that is rasterized.
9979 If antialiasing is enabled, line rasterization produces a fragment for
9980 each pixel square that intersects the region lying within the rectangle
9981 having width equal to the current line width, length equal to the actual
9982 length of the line, and centered on the mathematical line segment. The
9983 coverage value for each fragment is the window coordinate area of the
9984 intersection of the rectangular region with the corresponding pixel
9985 square. This value is saved and used in the final rasterization step.
9987 Not all widths can be supported when line antialiasing is enabled. If an
9988 unsupported width is requested, the nearest supported width is used.
9989 Only width 1 is guaranteed to be supported; others depend on the
9990 implementation. Likewise, there is a range for aliased line widths as
9991 well. To query the range of supported widths and the size difference
9992 between supported widths within the range, call `glGet' with arguments
9993 `GL_ALIASED_LINE_WIDTH_RANGE', `GL_SMOOTH_LINE_WIDTH_RANGE', and
9994 `GL_SMOOTH_LINE_WIDTH_GRANULARITY'.
9996 `GL_INVALID_VALUE' is generated if WIDTH is less than or equal to 0.
9998 `GL_INVALID_OPERATION' is generated if `glLineWidth' is executed between
9999 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10001 (define-gl-procedures
10002 ((glLinkProgram (program GLuint) -> void))
10003 "Links a program object.
10006 Specifies the handle of the program object to be linked.
10008 `glLinkProgram' links the program object specified by PROGRAM. If any
10009 shader objects of type `GL_VERTEX_SHADER' are attached to PROGRAM, they
10010 will be used to create an executable that will run on the programmable
10011 vertex processor. If any shader objects of type `GL_FRAGMENT_SHADER' are
10012 attached to PROGRAM, they will be used to create an executable that will
10013 run on the programmable fragment processor.
10015 The status of the link operation will be stored as part of the program
10016 object's state. This value will be set to `GL_TRUE' if the program
10017 object was linked without errors and is ready for use, and `GL_FALSE'
10018 otherwise. It can be queried by calling `glGetProgram' with arguments
10019 PROGRAM and `GL_LINK_STATUS'.
10021 As a result of a successful link operation, all active user-defined
10022 uniform variables belonging to PROGRAM will be initialized to 0, and
10023 each of the program object's active uniform variables will be assigned a
10024 location that can be queried by calling `glGetUniformLocation'. Also,
10025 any active user-defined attribute variables that have not been bound to
10026 a generic vertex attribute index will be bound to one at this time.
10028 Linking of a program object can fail for a number of reasons as
10029 specified in the OPENGL SHADING LANGUAGE SPECIFICATION. The following
10030 lists some of the conditions that will cause a link error.
10032 * The storage limit for uniform variables has been exceeded.
10034 * The number of active uniform variables supported by the
10035 implementation has been exceeded.
10037 * The `main' function is missing for the vertex shader or the
10040 * A varying variable actually used in the fragment shader is not
10041 declared in the same way (or is not declared at all) in the vertex
10044 * A reference to a function or variable name is unresolved.
10046 * A shared global is declared with two different types or two
10047 different initial values.
10049 * One or more of the attached shader objects has not been
10050 successfully compiled.
10052 * Binding a generic attribute matrix caused some rows of the matrix
10053 to fall outside the allowed maximum of `GL_MAX_VERTEX_ATTRIBS'.
10055 * Not enough contiguous vertex attribute slots could be found to bind
10056 attribute matrices.
10058 When a program object has been successfully linked, the program object
10059 can be made part of current state by calling `glUseProgram'. Whether or
10060 not the link operation was successful, the program object's information
10061 log will be overwritten. The information log can be retrieved by calling
10062 `glGetProgramInfoLog'.
10064 `glLinkProgram' will also install the generated executables as part of
10065 the current rendering state if the link operation was successful and the
10066 specified program object is already currently in use as a result of a
10067 previous call to `glUseProgram'. If the program object currently in use
10068 is relinked unsuccessfully, its link status will be set to `GL_FALSE' ,
10069 but the executables and associated state will remain part of the current
10070 state until a subsequent call to `glUseProgram' removes it from use.
10071 After it is removed from use, it cannot be made part of current state
10072 until it has been successfully relinked.
10074 If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but does
10075 not contain shader objects of type `GL_FRAGMENT_SHADER', the vertex
10076 shader will be linked against the implicit interface for fixed
10077 functionality fragment processing. Similarly, if PROGRAM contains shader
10078 objects of type `GL_FRAGMENT_SHADER' but it does not contain shader
10079 objects of type `GL_VERTEX_SHADER', the fragment shader will be linked
10080 against the implicit interface for fixed functionality vertex
10083 The program object's information log is updated and the program is
10084 generated at the time of the link operation. After the link operation,
10085 applications are free to modify attached shader objects, compile
10086 attached shader objects, detach shader objects, delete shader objects,
10087 and attach additional shader objects. None of these operations affects
10088 the information log or the program that is part of the program object.
10090 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
10093 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
10095 `GL_INVALID_OPERATION' is generated if `glLinkProgram' is executed
10096 between the execution of `glBegin' and the corresponding execution of
10099 (define-gl-procedures
10100 ((glListBase (base GLuint) -> void))
10101 "Set the display-list base for .
10104 Specifies an integer offset that will be added to `glCallLists'
10105 offsets to generate display-list names. The initial value is 0.
10107 `glCallLists' specifies an array of offsets. Display-list names are
10108 generated by adding BASE to each offset. Names that reference valid
10109 display lists are executed; the others are ignored.
10111 `GL_INVALID_OPERATION' is generated if `glListBase' is executed between
10112 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10114 (define-gl-procedures
10115 ((glLoadIdentity -> void))
10116 "Replace the current matrix with the identity matrix.
10118 `glLoadIdentity' replaces the current matrix with the identity matrix.
10119 It is semantically equivalent to calling `glLoadMatrix' with the
10124 ((1 0 0 0), (0 1 0 0), (0 0 1 0), (0 0 0 1),,)
10128 but in some cases it is more efficient.
10130 `GL_INVALID_OPERATION' is generated if `glLoadIdentity' is executed
10131 between the execution of `glBegin' and the corresponding execution of
10134 (define-gl-procedures
10135 ((glLoadMatrixf (m const-GLfloat-*) -> void))
10136 "Replace the current matrix with the specified matrix.
10139 Specifies a pointer to 16 consecutive values, which are used as the
10140 elements of a 4×4 column-major matrix.
10142 `glLoadMatrix' replaces the current matrix with the one whose elements
10143 are specified by M. The current matrix is the projection matrix,
10144 modelview matrix, or texture matrix, depending on the current matrix
10145 mode (see `glMatrixMode').
10147 The current matrix, M, defines a transformation of coordinates. For
10148 instance, assume M refers to the modelview matrix. If
10149 V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
10150 vertex, and M points to an array of 16 single- or double-precision
10151 floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
10152 transformation M\u2061(V,) does the following:
10154 M\u2061(V,)=((M\u2061[0,] M\u2061[4,] M\u2061[8,] M\u2061[12,]), (M\u2061[1,] M\u2061[5,] M\u2061[9,] M\u2061[13,]),
10155 (M\u2061[2,] M\u2061[6,] M\u2061[10,] M\u2061[14,]), (M\u2061[3,] M\u2061[7,] M\u2061[11,]
10156 M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
10160 Projection and texture transformations are similarly defined.
10162 `GL_INVALID_OPERATION' is generated if `glLoadMatrix' is executed
10163 between the execution of `glBegin' and the corresponding execution of
10166 (define-gl-procedures
10167 ((glLoadName (name GLuint) -> void))
10168 "Load a name onto the name stack.
10171 Specifies a name that will replace the top value on the name stack.
10173 The name stack is used during selection mode to allow sets of rendering
10174 commands to be uniquely identified. It consists of an ordered set of
10175 unsigned integers and is initially empty.
10177 `glLoadName' causes NAME to replace the value on the top of the name
10180 The name stack is always empty while the render mode is not `GL_SELECT'.
10181 Calls to `glLoadName' while the render mode is not `GL_SELECT' are
10184 `GL_INVALID_OPERATION' is generated if `glLoadName' is called while the
10185 name stack is empty.
10187 `GL_INVALID_OPERATION' is generated if `glLoadName' is executed between
10188 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10190 (define-gl-procedures
10191 ((glLoadTransposeMatrixf
10192 (m const-GLfloat-*)
10195 "Replace the current matrix with the specified row-major ordered matrix.
10198 Specifies a pointer to 16 consecutive values, which are used as the
10199 elements of a 4×4 row-major matrix.
10201 `glLoadTransposeMatrix' replaces the current matrix with the one whose
10202 elements are specified by M. The current matrix is the projection
10203 matrix, modelview matrix, or texture matrix, depending on the current
10204 matrix mode (see `glMatrixMode').
10206 The current matrix, M, defines a transformation of coordinates. For
10207 instance, assume M refers to the modelview matrix. If
10208 V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
10209 vertex, and M points to an array of 16 single- or double-precision
10210 floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
10211 transformation M\u2061(V,) does the following:
10213 M\u2061(V,)=((M\u2061[0,] M\u2061[1,] M\u2061[2,] M\u2061[3,]), (M\u2061[4,] M\u2061[5,] M\u2061[6,] M\u2061[7,]),
10214 (M\u2061[8,] M\u2061[9,] M\u2061[10,] M\u2061[11,]), (M\u2061[12,] M\u2061[13,] M\u2061[14,]
10215 M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
10219 Projection and texture transformations are similarly defined.
10221 Calling `glLoadTransposeMatrix' with matrix M is identical in operation
10222 to `glLoadMatrix' with M^T , where T represents the transpose.
10224 `GL_INVALID_OPERATION' is generated if `glLoadTransposeMatrix' is
10225 executed between the execution of `glBegin' and the corresponding
10226 execution of `glEnd'.")
10228 (define-gl-procedures
10229 ((glLogicOp (opcode GLenum) -> void))
10230 "Specify a logical pixel operation for color index rendering.
10233 Specifies a symbolic constant that selects a logical operation. The
10234 following symbols are accepted: `GL_CLEAR', `GL_SET', `GL_COPY',
10235 `GL_COPY_INVERTED', `GL_NOOP', `GL_INVERT', `GL_AND', `GL_NAND',
10236 `GL_OR', `GL_NOR', `GL_XOR', `GL_EQUIV', `GL_AND_REVERSE',
10237 `GL_AND_INVERTED', `GL_OR_REVERSE', and `GL_OR_INVERTED'. The
10238 initial value is `GL_COPY'.
10240 `glLogicOp' specifies a logical operation that, when enabled, is applied
10241 between the incoming color index or RGBA color and the color index or
10242 RGBA color at the corresponding location in the frame buffer. To enable
10243 or disable the logical operation, call `glEnable' and `glDisable' using
10244 the symbolic constant `GL_COLOR_LOGIC_OP' for RGBA mode or
10245 `GL_INDEX_LOGIC_OP' for color index mode. The initial value is disabled
10246 for both operations.
10251 *Resulting Operation*
10301 OPCODE is a symbolic constant chosen from the list above. In the
10302 explanation of the logical operations, S represents the incoming color
10303 index and D represents the index in the frame buffer. Standard
10304 C-language operators are used. As these bitwise operators suggest, the
10305 logical operation is applied independently to each bit pair of the
10306 source and destination indices or colors.
10308 `GL_INVALID_ENUM' is generated if OPCODE is not an accepted value.
10310 `GL_INVALID_OPERATION' is generated if `glLogicOp' is executed between
10311 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10313 (define-gl-procedures
10320 (points const-GLfloat-*)
10323 "Define a one-dimensional evaluator.
10326 Specifies the kind of values that are generated by the evaluator.
10327 Symbolic constants `GL_MAP1_VERTEX_3', `GL_MAP1_VERTEX_4',
10328 `GL_MAP1_INDEX', `GL_MAP1_COLOR_4', `GL_MAP1_NORMAL',
10329 `GL_MAP1_TEXTURE_COORD_1', `GL_MAP1_TEXTURE_COORD_2',
10330 `GL_MAP1_TEXTURE_COORD_3', and `GL_MAP1_TEXTURE_COORD_4' are
10336 Specify a linear mapping of U , as presented to `glEvalCoord1', to
10337 U^ , the variable that is evaluated by the equations specified by
10341 Specifies the number of floats or doubles between the beginning of
10342 one control point and the beginning of the next one in the data
10343 structure referenced in POINTS. This allows control points to be
10344 embedded in arbitrary data structures. The only constraint is that
10345 the values for a particular control point must occupy contiguous
10349 Specifies the number of control points. Must be positive.
10352 Specifies a pointer to the array of control points.
10354 Evaluators provide a way to use polynomial or rational polynomial
10355 mapping to produce vertices, normals, texture coordinates, and colors.
10356 The values produced by an evaluator are sent to further stages of GL
10357 processing just as if they had been presented using `glVertex',
10358 `glNormal', `glTexCoord', and `glColor' commands, except that the
10359 generated values do not update the current normal, texture coordinates,
10362 All polynomial or rational polynomial splines of any degree (up to the
10363 maximum degree supported by the GL implementation) can be described
10364 using evaluators. These include almost all splines used in computer
10365 graphics: B-splines, Bezier curves, Hermite splines, and so on.
10367 Evaluators define curves based on Bernstein polynomials. Define P\u2061(U^,)
10370 P\u2061(U^,)=ΣI=0NB_I,^N\u2061(U^,)\u2062R_I
10374 where R_I is a control point and B_I,^N\u2061(U^,) is the I th Bernstein
10375 polynomial of degree N (ORDER = N+1 ):
10377 B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
10381 0^0==1 and ((N), (0),,)==1
10383 `glMap1' is used to define the basis and to specify what kind of values
10384 are produced. Once defined, a map can be enabled and disabled by calling
10385 `glEnable' and `glDisable' with the map name, one of the nine predefined
10386 values for TARGET described below. `glEvalCoord1' evaluates the
10387 one-dimensional maps that are enabled. When `glEvalCoord1' presents a
10388 value U , the Bernstein functions are evaluated using U^ , where
10391 TARGET is a symbolic constant that indicates what kind of control points
10392 are provided in POINTS, and what output is generated when the map is
10393 evaluated. It can assume one of nine predefined values:
10396 Each control point is three floating-point values representing X ,
10397 Y , and Z . Internal `glVertex3' commands are generated when the
10401 Each control point is four floating-point values representing X , Y
10402 , Z , and W . Internal `glVertex4' commands are generated when the
10406 Each control point is a single floating-point value representing a
10407 color index. Internal `glIndex' commands are generated when the map
10408 is evaluated but the current index is not updated with the value of
10409 these `glIndex' commands.
10412 Each control point is four floating-point values representing red,
10413 green, blue, and alpha. Internal `glColor4' commands are generated
10414 when the map is evaluated but the current color is not updated with
10415 the value of these `glColor4' commands.
10418 Each control point is three floating-point values representing the
10419 X , Y , and Z components of a normal vector. Internal `glNormal'
10420 commands are generated when the map is evaluated but the current
10421 normal is not updated with the value of these `glNormal' commands.
10423 `GL_MAP1_TEXTURE_COORD_1'
10424 Each control point is a single floating-point value representing
10425 the S texture coordinate. Internal `glTexCoord1' commands are
10426 generated when the map is evaluated but the current texture
10427 coordinates are not updated with the value of these `glTexCoord'
10430 `GL_MAP1_TEXTURE_COORD_2'
10431 Each control point is two floating-point values representing the S
10432 and T texture coordinates. Internal `glTexCoord2' commands are
10433 generated when the map is evaluated but the current texture
10434 coordinates are not updated with the value of these `glTexCoord'
10437 `GL_MAP1_TEXTURE_COORD_3'
10438 Each control point is three floating-point values representing the
10439 S , T , and R texture coordinates. Internal `glTexCoord3' commands
10440 are generated when the map is evaluated but the current texture
10441 coordinates are not updated with the value of these `glTexCoord'
10444 `GL_MAP1_TEXTURE_COORD_4'
10445 Each control point is four floating-point values representing the S
10446 , T , R , and Q texture coordinates. Internal `glTexCoord4'
10447 commands are generated when the map is evaluated but the current
10448 texture coordinates are not updated with the value of these
10449 `glTexCoord' commands.
10451 STRIDE, ORDER, and POINTS define the array addressing for accessing the
10452 control points. POINTS is the location of the first control point, which
10453 occupies one, two, three, or four contiguous memory locations, depending
10454 on which map is being defined. ORDER is the number of control points in
10455 the array. STRIDE specifies how many float or double locations to
10456 advance the internal memory pointer to reach the next control point.
10458 `GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
10460 `GL_INVALID_VALUE' is generated if U1 is equal to U2.
10462 `GL_INVALID_VALUE' is generated if STRIDE is less than the number of
10463 values in a control point.
10465 `GL_INVALID_VALUE' is generated if ORDER is less than 1 or greater than
10466 the return value of `GL_MAX_EVAL_ORDER'.
10468 `GL_INVALID_OPERATION' is generated if `glMap1' is executed between the
10469 execution of `glBegin' and the corresponding execution of `glEnd'.
10471 `GL_INVALID_OPERATION' is generated if `glMap1' is called and the value
10472 of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
10474 (define-gl-procedures
10485 (points const-GLfloat-*)
10488 "Define a two-dimensional evaluator.
10491 Specifies the kind of values that are generated by the evaluator.
10492 Symbolic constants `GL_MAP2_VERTEX_3', `GL_MAP2_VERTEX_4',
10493 `GL_MAP2_INDEX', `GL_MAP2_COLOR_4', `GL_MAP2_NORMAL',
10494 `GL_MAP2_TEXTURE_COORD_1', `GL_MAP2_TEXTURE_COORD_2',
10495 `GL_MAP2_TEXTURE_COORD_3', and `GL_MAP2_TEXTURE_COORD_4' are
10501 Specify a linear mapping of U , as presented to `glEvalCoord2', to
10502 U^ , one of the two variables that are evaluated by the equations
10503 specified by this command. Initially, U1 is 0 and U2 is 1.
10506 Specifies the number of floats or doubles between the beginning of
10507 control point R_IJ and the beginning of control point R_(I+1,)\u2062J, ,
10508 where I and J are the U and V control point indices, respectively.
10509 This allows control points to be embedded in arbitrary data
10510 structures. The only constraint is that the values for a particular
10511 control point must occupy contiguous memory locations. The initial
10512 value of USTRIDE is 0.
10515 Specifies the dimension of the control point array in the U axis.
10516 Must be positive. The initial value is 1.
10521 Specify a linear mapping of V , as presented to `glEvalCoord2', to
10522 V^ , one of the two variables that are evaluated by the equations
10523 specified by this command. Initially, V1 is 0 and V2 is 1.
10526 Specifies the number of floats or doubles between the beginning of
10527 control point R_IJ and the beginning of control point R_I\u2061(J+1,), ,
10528 where I and J are the U and V control point indices, respectively.
10529 This allows control points to be embedded in arbitrary data
10530 structures. The only constraint is that the values for a particular
10531 control point must occupy contiguous memory locations. The initial
10532 value of VSTRIDE is 0.
10535 Specifies the dimension of the control point array in the V axis.
10536 Must be positive. The initial value is 1.
10539 Specifies a pointer to the array of control points.
10541 Evaluators provide a way to use polynomial or rational polynomial
10542 mapping to produce vertices, normals, texture coordinates, and colors.
10543 The values produced by an evaluator are sent on to further stages of GL
10544 processing just as if they had been presented using `glVertex',
10545 `glNormal', `glTexCoord', and `glColor' commands, except that the
10546 generated values do not update the current normal, texture coordinates,
10549 All polynomial or rational polynomial splines of any degree (up to the
10550 maximum degree supported by the GL implementation) can be described
10551 using evaluators. These include almost all surfaces used in computer
10552 graphics, including B-spline surfaces, NURBS surfaces, Bezier surfaces,
10555 Evaluators define surfaces based on bivariate Bernstein polynomials.
10556 Define P\u2061(U^,V^) as
10558 P\u2061(U^,V^)=ΣI=0NΣJ=0MB_I,^N\u2061(U^,)\u2062B_J,^M\u2061(V^,)\u2062R_IJ
10562 where R_IJ is a control point, B_I,^N\u2061(U^,) is the I th Bernstein
10563 polynomial of degree N (UORDER = N+1 )
10565 B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
10567 and B_J,^M\u2061(V^,) is the J th Bernstein polynomial of degree M (VORDER =
10570 B_J,^M\u2061(V^,)=((M), (J),,)\u2062V^,^J\u2062(1-V^,)^M-J,,
10572 Recall that 0^0==1 and ((N), (0),,)==1
10574 `glMap2' is used to define the basis and to specify what kind of values
10575 are produced. Once defined, a map can be enabled and disabled by calling
10576 `glEnable' and `glDisable' with the map name, one of the nine predefined
10577 values for TARGET, described below. When `glEvalCoord2' presents values
10578 U and V , the bivariate Bernstein polynomials are evaluated using U^ and
10585 TARGET is a symbolic constant that indicates what kind of control points
10586 are provided in POINTS, and what output is generated when the map is
10587 evaluated. It can assume one of nine predefined values:
10590 Each control point is three floating-point values representing X ,
10591 Y , and Z . Internal `glVertex3' commands are generated when the
10595 Each control point is four floating-point values representing X , Y
10596 , Z , and W . Internal `glVertex4' commands are generated when the
10600 Each control point is a single floating-point value representing a
10601 color index. Internal `glIndex' commands are generated when the map
10602 is evaluated but the current index is not updated with the value of
10603 these `glIndex' commands.
10606 Each control point is four floating-point values representing red,
10607 green, blue, and alpha. Internal `glColor4' commands are generated
10608 when the map is evaluated but the current color is not updated with
10609 the value of these `glColor4' commands.
10612 Each control point is three floating-point values representing the
10613 X , Y , and Z components of a normal vector. Internal `glNormal'
10614 commands are generated when the map is evaluated but the current
10615 normal is not updated with the value of these `glNormal' commands.
10617 `GL_MAP2_TEXTURE_COORD_1'
10618 Each control point is a single floating-point value representing
10619 the S texture coordinate. Internal `glTexCoord1' commands are
10620 generated when the map is evaluated but the current texture
10621 coordinates are not updated with the value of these `glTexCoord'
10624 `GL_MAP2_TEXTURE_COORD_2'
10625 Each control point is two floating-point values representing the S
10626 and T texture coordinates. Internal `glTexCoord2' commands are
10627 generated when the map is evaluated but the current texture
10628 coordinates are not updated with the value of these `glTexCoord'
10631 `GL_MAP2_TEXTURE_COORD_3'
10632 Each control point is three floating-point values representing the
10633 S , T , and R texture coordinates. Internal `glTexCoord3' commands
10634 are generated when the map is evaluated but the current texture
10635 coordinates are not updated with the value of these `glTexCoord'
10638 `GL_MAP2_TEXTURE_COORD_4'
10639 Each control point is four floating-point values representing the S
10640 , T , R , and Q texture coordinates. Internal `glTexCoord4'
10641 commands are generated when the map is evaluated but the current
10642 texture coordinates are not updated with the value of these
10643 `glTexCoord' commands.
10645 USTRIDE, UORDER, VSTRIDE, VORDER, and POINTS define the array addressing
10646 for accessing the control points. POINTS is the location of the first
10647 control point, which occupies one, two, three, or four contiguous memory
10648 locations, depending on which map is being defined. There are
10649 UORDER×VORDER control points in the array. USTRIDE specifies how many
10650 float or double locations are skipped to advance the internal memory
10651 pointer from control point R_I\u2062J, to control point R_(I+1,)\u2062J, . VSTRIDE
10652 specifies how many float or double locations are skipped to advance the
10653 internal memory pointer from control point R_I\u2062J, to control point
10656 `GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
10658 `GL_INVALID_VALUE' is generated if U1 is equal to U2, or if V1 is equal
10661 `GL_INVALID_VALUE' is generated if either USTRIDE or VSTRIDE is less
10662 than the number of values in a control point.
10664 `GL_INVALID_VALUE' is generated if either UORDER or VORDER is less than
10665 1 or greater than the return value of `GL_MAX_EVAL_ORDER'.
10667 `GL_INVALID_OPERATION' is generated if `glMap2' is executed between the
10668 execution of `glBegin' and the corresponding execution of `glEnd'.
10670 `GL_INVALID_OPERATION' is generated if `glMap2' is called and the value
10671 of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
10673 (define-gl-procedures
10679 (glUnmapBuffer (target GLenum) -> GLboolean))
10680 "Map a buffer object's data store.
10683 Specifies the target buffer object being mapped. The symbolic
10684 constant must be `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
10685 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
10688 Specifies the access policy, indicating whether it will be possible
10689 to read from, write to, or both read from and write to the buffer
10690 object's mapped data store. The symbolic constant must be
10691 `GL_READ_ONLY', `GL_WRITE_ONLY', or `GL_READ_WRITE'.
10693 `glMapBuffer' maps to the client's address space the entire data store
10694 of the buffer object currently bound to TARGET. The data can then be
10695 directly read and/or written relative to the returned pointer, depending
10696 on the specified ACCESS policy. If the GL is unable to map the buffer
10697 object's data store, `glMapBuffer' generates an error and returns
10698 `NULL'. This may occur for system-specific reasons, such as low virtual
10699 memory availability.
10701 If a mapped data store is accessed in a way inconsistent with the
10702 specified ACCESS policy, no error is generated, but performance may be
10703 negatively impacted and system errors, including program termination,
10704 may result. Unlike the USAGE parameter of `glBufferData', ACCESS is not
10705 a hint, and does in fact constrain the usage of the mapped data store on
10706 some GL implementations. In order to achieve the highest performance
10707 available, a buffer object's data store should be used in ways
10708 consistent with both its specified USAGE and ACCESS parameters.
10710 A mapped data store must be unmapped with `glUnmapBuffer' before its
10711 buffer object is used. Otherwise an error will be generated by any GL
10712 command that attempts to dereference the buffer object's data store.
10713 When a data store is unmapped, the pointer to its data store becomes
10714 invalid. `glUnmapBuffer' returns `GL_TRUE' unless the data store
10715 contents have become corrupt during the time the data store was mapped.
10716 This can occur for system-specific reasons that affect the availability
10717 of graphics memory, such as screen mode changes. In such situations,
10718 `GL_FALSE' is returned and the data store contents are undefined. An
10719 application must detect this rare condition and reinitialize the data
10722 A buffer object's mapped data store is automatically unmapped when the
10723 buffer object is deleted or its data store is recreated with
10726 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
10727 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
10728 `GL_PIXEL_UNPACK_BUFFER'.
10730 `GL_INVALID_ENUM' is generated if ACCESS is not `GL_READ_ONLY',
10731 `GL_WRITE_ONLY', or `GL_READ_WRITE'.
10733 `GL_OUT_OF_MEMORY' is generated when `glMapBuffer' is executed if the GL
10734 is unable to map the buffer object's data store. This may occur for a
10735 variety of system-specific reasons, such as the absence of sufficient
10736 remaining virtual memory.
10738 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
10739 is bound to TARGET.
10741 `GL_INVALID_OPERATION' is generated if `glMapBuffer' is executed for a
10742 buffer object whose data store is already mapped.
10744 `GL_INVALID_OPERATION' is generated if `glUnmapBuffer' is executed for a
10745 buffer object whose data store is not currently mapped.
10747 `GL_INVALID_OPERATION' is generated if `glMapBuffer' or `glUnmapBuffer'
10748 is executed between the execution of `glBegin' and the corresponding
10749 execution of `glEnd'.")
10751 (define-gl-procedures
10767 "Define a one- or two-dimensional mesh.
10770 Specifies the number of partitions in the grid range interval [U1,
10771 U2]. Must be positive.
10776 Specify the mappings for integer grid domain values I=0 and I=UN .
10779 Specifies the number of partitions in the grid range interval [V1,
10780 V2] (`glMapGrid2' only).
10785 Specify the mappings for integer grid domain values J=0 and J=VN
10786 (`glMapGrid2' only).
10788 `glMapGrid' and `glEvalMesh' are used together to efficiently generate
10789 and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
10790 steps through the integer domain of a one- or two-dimensional grid,
10791 whose range is the domain of the evaluation maps specified by `glMap1'
10794 `glMapGrid1' and `glMapGrid2' specify the linear grid mappings between
10795 the I (or I and J ) integer grid coordinates, to the U (or U and V )
10796 floating-point evaluation map coordinates. See `glMap1' and `glMap2' for
10797 details of how U and V coordinates are evaluated.
10799 `glMapGrid1' specifies a single linear mapping such that integer grid
10800 coordinate 0 maps exactly to U1, and integer grid coordinate UN maps
10801 exactly to U2. All other integer grid coordinates I are mapped so that
10803 U=I\u2061(U2-U1,)/UN+U1
10805 `glMapGrid2' specifies two such linear mappings. One maps integer grid
10806 coordinate I=0 exactly to U1, and integer grid coordinate I=UN exactly
10807 to U2. The other maps integer grid coordinate J=0 exactly to V1, and
10808 integer grid coordinate J=VN exactly to V2. Other integer grid
10809 coordinates I and J are mapped such that
10811 U=I\u2061(U2-U1,)/UN+U1
10813 V=J\u2061(V2-V1,)/VN+V1
10815 The mappings specified by `glMapGrid' are used identically by
10816 `glEvalMesh' and `glEvalPoint'.
10818 `GL_INVALID_VALUE' is generated if either UN or VN is not positive.
10820 `GL_INVALID_OPERATION' is generated if `glMapGrid' is executed between
10821 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10823 (define-gl-procedures
10836 "Specify material parameters for the lighting model.
10839 Specifies which face or faces are being updated. Must be one of
10840 `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
10843 Specifies the single-valued material parameter of the face or faces
10844 that is being updated. Must be `GL_SHININESS'.
10847 Specifies the value that parameter `GL_SHININESS' will be set to.
10849 `glMaterial' assigns values to material parameters. There are two
10850 matched sets of material parameters. One, the FRONT-FACING set, is used
10851 to shade points, lines, bitmaps, and all polygons (when two-sided
10852 lighting is disabled), or just front-facing polygons (when two-sided
10853 lighting is enabled). The other set, BACK-FACING, is used to shade
10854 back-facing polygons only when two-sided lighting is enabled. Refer to
10855 the `glLightModel' reference page for details concerning one- and
10856 two-sided lighting calculations.
10858 `glMaterial' takes three arguments. The first, FACE, specifies whether
10859 the `GL_FRONT' materials, the `GL_BACK' materials, or both
10860 `GL_FRONT_AND_BACK' materials will be modified. The second, PNAME,
10861 specifies which of several parameters in one or both sets will be
10862 modified. The third, PARAMS, specifies what value or values will be
10863 assigned to the specified parameter.
10865 Material parameters are used in the lighting equation that is optionally
10866 applied to each vertex. The equation is discussed in the `glLightModel'
10867 reference page. The parameters that can be specified using `glMaterial',
10868 and their interpretations by the lighting equation, are as follows:
10871 PARAMS contains four integer or floating-point values that specify
10872 the ambient RGBA reflectance of the material. Integer values are
10873 mapped linearly such that the most positive representable value
10874 maps to 1.0, and the most negative representable value maps to -1.0
10875 . Floating-point values are mapped directly. Neither integer nor
10876 floating-point values are clamped. The initial ambient reflectance
10877 for both front- and back-facing materials is (0.2, 0.2, 0.2, 1.0).
10880 PARAMS contains four integer or floating-point values that specify
10881 the diffuse RGBA reflectance of the material. Integer values are
10882 mapped linearly such that the most positive representable value
10883 maps to 1.0, and the most negative representable value maps to -1.0
10884 . Floating-point values are mapped directly. Neither integer nor
10885 floating-point values are clamped. The initial diffuse reflectance
10886 for both front- and back-facing materials is (0.8, 0.8, 0.8, 1.0).
10889 PARAMS contains four integer or floating-point values that specify
10890 the specular RGBA reflectance of the material. Integer values are
10891 mapped linearly such that the most positive representable value
10892 maps to 1.0, and the most negative representable value maps to -1.0
10893 . Floating-point values are mapped directly. Neither integer nor
10894 floating-point values are clamped. The initial specular reflectance
10895 for both front- and back-facing materials is (0, 0, 0, 1).
10898 PARAMS contains four integer or floating-point values that specify
10899 the RGBA emitted light intensity of the material. Integer values
10900 are mapped linearly such that the most positive representable value
10901 maps to 1.0, and the most negative representable value maps to -1.0
10902 . Floating-point values are mapped directly. Neither integer nor
10903 floating-point values are clamped. The initial emission intensity
10904 for both front- and back-facing materials is (0, 0, 0, 1).
10907 PARAMS is a single integer or floating-point value that specifies
10908 the RGBA specular exponent of the material. Integer and
10909 floating-point values are mapped directly. Only values in the range
10910 [0,128] are accepted. The initial specular exponent for both front-
10911 and back-facing materials is 0.
10913 `GL_AMBIENT_AND_DIFFUSE'
10914 Equivalent to calling `glMaterial' twice with the same parameter
10915 values, once with `GL_AMBIENT' and once with `GL_DIFFUSE'.
10918 PARAMS contains three integer or floating-point values specifying
10919 the color indices for ambient, diffuse, and specular lighting.
10920 These three values, and `GL_SHININESS', are the only material
10921 values used by the color index mode lighting equation. Refer to the
10922 `glLightModel' reference page for a discussion of color index
10925 `GL_INVALID_ENUM' is generated if either FACE or PNAME is not an
10928 `GL_INVALID_VALUE' is generated if a specular exponent outside the range
10929 [0,128] is specified.")
10931 (define-gl-procedures
10932 ((glMatrixMode (mode GLenum) -> void))
10933 "Specify which matrix is the current matrix.
10936 Specifies which matrix stack is the target for subsequent matrix
10937 operations. Three values are accepted: `GL_MODELVIEW',
10938 `GL_PROJECTION', and `GL_TEXTURE'. The initial value is
10939 `GL_MODELVIEW'. Additionally, if the `ARB_imaging' extension is
10940 supported, `GL_COLOR' is also accepted.
10942 `glMatrixMode' sets the current matrix mode. MODE can assume one of four
10946 Applies subsequent matrix operations to the modelview matrix stack.
10949 Applies subsequent matrix operations to the projection matrix
10953 Applies subsequent matrix operations to the texture matrix stack.
10956 Applies subsequent matrix operations to the color matrix stack.
10958 To find out which matrix stack is currently the target of all matrix
10959 operations, call `glGet' with argument `GL_MATRIX_MODE'. The initial
10960 value is `GL_MODELVIEW'.
10962 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
10964 `GL_INVALID_OPERATION' is generated if `glMatrixMode' is executed
10965 between the execution of `glBegin' and the corresponding execution of
10968 (define-gl-procedures
10971 (internalformat GLenum)
10975 "Define minmax table.
10978 The minmax table whose parameters are to be set. Must be
10982 The format of entries in the minmax table. Must be one of
10983 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
10984 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
10985 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
10986 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
10987 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
10988 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
10989 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
10990 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
10991 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
10994 If `GL_TRUE', pixels will be consumed by the minmax process and no
10995 drawing or texture loading will take place. If `GL_FALSE', pixels
10996 will proceed to the final conversion process after minmax.
10998 When `GL_MINMAX' is enabled, the RGBA components of incoming pixels are
10999 compared to the minimum and maximum values for each component, which are
11000 stored in the two-element minmax table. (The first element stores the
11001 minima, and the second element stores the maxima.) If a pixel component
11002 is greater than the corresponding component in the maximum element, then
11003 the maximum element is updated with the pixel component value. If a
11004 pixel component is less than the corresponding component in the minimum
11005 element, then the minimum element is updated with the pixel component
11006 value. (In both cases, if the internal format of the minmax table
11007 includes luminance, then the R color component of incoming pixels is
11008 used for comparison.) The contents of the minmax table may be retrieved
11009 at a later time by calling `glGetMinmax'. The minmax operation is
11010 enabled or disabled by calling `glEnable' or `glDisable', respectively,
11011 with an argument of `GL_MINMAX'.
11013 `glMinmax' redefines the current minmax table to have entries of the
11014 format specified by INTERNALFORMAT. The maximum element is initialized
11015 with the smallest possible component values, and the minimum element is
11016 initialized with the largest possible component values. The values in
11017 the previous minmax table, if any, are lost. If SINK is `GL_TRUE', then
11018 pixels are discarded after minmax; no further processing of the pixels
11019 takes place, and no drawing, texture loading, or pixel readback will
11024 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
11027 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
11030 `GL_INVALID_OPERATION' is generated if `glMinmax' is executed between
11031 the execution of `glBegin' and the corresponding execution of `glEnd'.")
11033 (define-gl-procedures
11034 ((glMultiDrawArrays
11038 (primcount GLsizei)
11041 "Render multiple sets of primitives from array data.
11044 Specifies what kind of primitives to render. Symbolic constants
11045 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
11046 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
11047 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
11050 Points to an array of starting indices in the enabled arrays.
11053 Points to an array of the number of indices to be rendered.
11056 Specifies the size of the first and count
11058 `glMultiDrawArrays' specifies multiple sets of geometric primitives with
11059 very few subroutine calls. Instead of calling a GL procedure to pass
11060 each individual vertex, normal, texture coordinate, edge flag, or color,
11061 you can prespecify separate arrays of vertices, normals, and colors and
11062 use them to construct a sequence of primitives with a single call to
11063 `glMultiDrawArrays'.
11065 `glMultiDrawArrays' behaves identically to `glDrawArrays' except that
11066 PRIMCOUNT separate ranges of elements are specified instead.
11068 When `glMultiDrawArrays' is called, it uses COUNT sequential elements
11069 from each enabled array to construct a sequence of geometric primitives,
11070 beginning with element FIRST. MODE specifies what kind of primitives are
11071 constructed, and how the array elements construct those primitives. If
11072 `GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
11074 Vertex attributes that are modified by `glMultiDrawArrays' have an
11075 unspecified value after `glMultiDrawArrays' returns. For example, if
11076 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
11077 after `glMultiDrawArrays' executes. Attributes that aren't modified
11078 remain well defined.
11080 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11082 `GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
11084 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
11085 bound to an enabled array and the buffer object's data store is
11088 `GL_INVALID_OPERATION' is generated if `glMultiDrawArrays' is executed
11089 between the execution of `glBegin' and the corresponding `glEnd'.")
11091 (define-gl-procedures
11092 ((glMultiDrawElements
11094 (count const-GLsizei-*)
11096 (indices const-GLvoid-**)
11097 (primcount GLsizei)
11100 "Render multiple sets of primitives by specifying indices of array data
11104 Specifies what kind of primitives to render. Symbolic constants
11105 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
11106 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
11107 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
11110 Points to an array of the elements counts.
11113 Specifies the type of the values in INDICES. Must be one of
11114 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
11117 Specifies a pointer to the location where the indices are stored.
11120 Specifies the size of the COUNT array.
11122 `glMultiDrawElements' specifies multiple sets of geometric primitives
11123 with very few subroutine calls. Instead of calling a GL function to pass
11124 each individual vertex, normal, texture coordinate, edge flag, or color,
11125 you can prespecify separate arrays of vertices, normals, and so on, and
11126 use them to construct a sequence of primitives with a single call to
11127 `glMultiDrawElements'.
11129 `glMultiDrawElements' is identical in operation to `glDrawElements'
11130 except that PRIMCOUNT separate lists of elements are specified.
11132 Vertex attributes that are modified by `glMultiDrawElements' have an
11133 unspecified value after `glMultiDrawElements' returns. For example, if
11134 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
11135 after `glMultiDrawElements' executes. Attributes that aren't modified
11136 maintain their previous values.
11138 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11140 `GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
11142 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
11143 bound to an enabled array or the element array and the buffer object's
11144 data store is currently mapped.
11146 `GL_INVALID_OPERATION' is generated if `glMultiDrawElements' is executed
11147 between the execution of `glBegin' and the corresponding `glEnd'.")
11149 (define-gl-procedures
11150 ((glMultiTexCoord1i
11202 "Set the current texture coordinates.
11205 Specifies the texture unit whose coordinates should be modified.
11206 The number of texture units is implementation dependent, but must
11207 be at least two. Symbolic constant must be one of `GL_TEXTURE' I ,
11208 where i ranges from 0 to `GL_MAX_TEXTURE_COORDS' - 1, which is an
11209 implementation-dependent value.
11218 Specify S, T, R, and Q texture coordinates for TARGET texture unit.
11219 Not all parameters are present in all forms of the command.
11221 `glMultiTexCoord' specifies texture coordinates in one, two, three, or
11222 four dimensions. `glMultiTexCoord1' sets the current texture coordinates
11223 to (S,001) ; a call to `glMultiTexCoord2' sets them to (S,T01) .
11224 Similarly, `glMultiTexCoord3' specifies the texture coordinates as
11225 (S,TR1) , and `glMultiTexCoord4' defines all four components explicitly
11228 The current texture coordinates are part of the data that is associated
11229 with each vertex and with the current raster position. Initially, the
11230 values for (S,TRQ) are (0,001) .")
11232 (define-gl-procedures
11233 ((glMultMatrixf (m const-GLfloat-*) -> void))
11234 "Multiply the current matrix with the specified matrix.
11237 Points to 16 consecutive values that are used as the elements of a
11238 4×4 column-major matrix.
11240 `glMultMatrix' multiplies the current matrix with the one specified
11241 using M, and replaces the current matrix with the product.
11243 The current matrix is determined by the current matrix mode (see
11244 `glMatrixMode'). It is either the projection matrix, modelview matrix,
11245 or the texture matrix.
11247 `GL_INVALID_OPERATION' is generated if `glMultMatrix' is executed
11248 between the execution of `glBegin' and the corresponding execution of
11251 (define-gl-procedures
11252 ((glMultTransposeMatrixf
11253 (m const-GLfloat-*)
11256 "Multiply the current matrix with the specified row-major ordered matrix.
11259 Points to 16 consecutive values that are used as the elements of a
11260 4×4 row-major matrix.
11262 `glMultTransposeMatrix' multiplies the current matrix with the one
11263 specified using M, and replaces the current matrix with the product.
11265 The current matrix is determined by the current matrix mode (see
11266 `glMatrixMode'). It is either the projection matrix, modelview matrix,
11267 or the texture matrix.
11269 `GL_INVALID_OPERATION' is generated if `glMultTransposeMatrix' is
11270 executed between the execution of `glBegin' and the corresponding
11271 execution of `glEnd'.")
11273 (define-gl-procedures
11274 ((glNewList (list GLuint) (mode GLenum) -> void)
11275 (glEndList -> void))
11276 "Create or replace a display list.
11279 Specifies the display-list name.
11282 Specifies the compilation mode, which can be `GL_COMPILE' or
11283 `GL_COMPILE_AND_EXECUTE'.
11285 Display lists are groups of GL commands that have been stored for
11286 subsequent execution. Display lists are created with `glNewList'. All
11287 subsequent commands are placed in the display list, in the order issued,
11288 until `glEndList' is called.
11290 `glNewList' has two arguments. The first argument, LIST, is a positive
11291 integer that becomes the unique name for the display list. Names can be
11292 created and reserved with `glGenLists' and tested for uniqueness with
11293 `glIsList'. The second argument, MODE, is a symbolic constant that can
11294 assume one of two values:
11297 Commands are merely compiled.
11299 `GL_COMPILE_AND_EXECUTE'
11300 Commands are executed as they are compiled into the display list.
11302 Certain commands are not compiled into the display list but are executed
11303 immediately, regardless of the display-list mode. These commands are
11304 `glAreTexturesResident', `glColorPointer', `glDeleteLists',
11305 `glDeleteTextures', `glDisableClientState', `glEdgeFlagPointer',
11306 `glEnableClientState', `glFeedbackBuffer', `glFinish', `glFlush',
11307 `glGenLists', `glGenTextures', `glIndexPointer', `glInterleavedArrays',
11308 `glIsEnabled', `glIsList', `glIsTexture', `glNormalPointer',
11309 `glPopClientAttrib', `glPixelStore', `glPushClientAttrib',
11310 `glReadPixels', `glRenderMode', `glSelectBuffer', `glTexCoordPointer',
11311 `glVertexPointer', and all of the `glGet' commands.
11313 Similarly, `glTexImage1D', `glTexImage2D', and `glTexImage3D' are
11314 executed immediately and not compiled into the display list when their
11315 first argument is `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_1D', or
11316 `GL_PROXY_TEXTURE_3D', respectively.
11318 When the `ARB_imaging' extension is supported, `glHistogram' executes
11319 immediately when its argument is `GL_PROXY_HISTOGRAM'. Similarly,
11320 `glColorTable' executes immediately when its first argument is
11321 `GL_PROXY_COLOR_TABLE', `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
11322 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
11324 For OpenGL versions 1.3 and greater, or when the `ARB_multitexture'
11325 extension is supported, `glClientActiveTexture' is not compiled into
11326 display lists, but executed immediately.
11328 When `glEndList' is encountered, the display-list definition is
11329 completed by associating the list with the unique name LIST (specified
11330 in the `glNewList' command). If a display list with name LIST already
11331 exists, it is replaced only when `glEndList' is called.
11333 `GL_INVALID_VALUE' is generated if LIST is 0.
11335 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11337 `GL_INVALID_OPERATION' is generated if `glEndList' is called without a
11338 preceding `glNewList', or if `glNewList' is called while a display list
11341 `GL_INVALID_OPERATION' is generated if `glNewList' or `glEndList' is
11342 executed between the execution of `glBegin' and the corresponding
11343 execution of `glEnd'.
11345 `GL_OUT_OF_MEMORY' is generated if there is insufficient memory to
11346 compile the display list. If the GL version is 1.1 or greater, no change
11347 is made to the previous contents of the display list, if any, and no
11348 other change is made to the GL state. (It is as if no attempt had been
11349 made to create the new display list.)")
11351 (define-gl-procedures
11355 (pointer const-GLvoid-*)
11358 "Define an array of normals.
11361 Specifies the data type of each coordinate in the array. Symbolic
11362 constants `GL_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
11363 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
11366 Specifies the byte offset between consecutive normals. If STRIDE is
11367 0, the normals are understood to be tightly packed in the array.
11368 The initial value is 0.
11371 Specifies a pointer to the first coordinate of the first normal in
11372 the array. The initial value is 0.
11374 `glNormalPointer' specifies the location and data format of an array of
11375 normals to use when rendering. TYPE specifies the data type of each
11376 normal coordinate, and STRIDE specifies the byte stride from one normal
11377 to the next, allowing vertices and attributes to be packed into a single
11378 array or stored in separate arrays. (Single-array storage may be more
11379 efficient on some implementations; see `glInterleavedArrays'.)
11381 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
11382 target (see `glBindBuffer') while a normal array is specified, POINTER
11383 is treated as a byte offset into the buffer object's data store. Also,
11384 the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as normal
11385 vertex array client-side state (`GL_NORMAL_ARRAY_BUFFER_BINDING').
11387 When a normal array is specified, TYPE, STRIDE, and POINTER are saved as
11388 client-side state, in addition to the current vertex array buffer object
11391 To enable and disable the normal array, call `glEnableClientState' and
11392 `glDisableClientState' with the argument `GL_NORMAL_ARRAY'. If enabled,
11393 the normal array is used when `glDrawArrays', `glMultiDrawArrays',
11394 `glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
11395 `glArrayElement' is called.
11397 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
11399 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
11401 (define-gl-procedures
11414 "Set the current normal vector.
11421 Specify the X , Y , and Z coordinates of the new current normal.
11422 The initial value of the current normal is the unit vector, (0, 0,
11427 The current normal is set to the given coordinates whenever `glNormal'
11428 is issued. Byte, short, or integer arguments are converted to
11429 floating-point format with a linear mapping that maps the most positive
11430 representable integer value to 1.0 and the most negative representable
11431 integer value to -1.0 .
11433 Normals specified with `glNormal' need not have unit length. If
11434 `GL_NORMALIZE' is enabled, then normals of any length specified with
11435 `glNormal' are normalized after transformation. If `GL_RESCALE_NORMAL'
11436 is enabled, normals are scaled by a scaling factor derived from the
11437 modelview matrix. `GL_RESCALE_NORMAL' requires that the originally
11438 specified normals were of unit length, and that the modelview matrix
11439 contain only uniform scales for proper results. To enable and disable
11440 normalization, call `glEnable' and `glDisable' with either
11441 `GL_NORMALIZE' or `GL_RESCALE_NORMAL'. Normalization is initially
11444 (define-gl-procedures
11454 "Multiply the current matrix with an orthographic matrix.
11459 Specify the coordinates for the left and right vertical clipping
11465 Specify the coordinates for the bottom and top horizontal clipping
11471 Specify the distances to the nearer and farther depth clipping
11472 planes. These values are negative if the plane is to be behind the
11475 `glOrtho' describes a transformation that produces a parallel
11476 projection. The current matrix (see `glMatrixMode') is multiplied by
11477 this matrix and the result replaces the current matrix, as if
11478 `glMultMatrix' were called with the following matrix as its argument:
11480 ((2/RIGHT-LEFT,, 0 0 T_X,), (0 2/TOP-BOTTOM,, 0 T_Y,), (0 0
11481 -2/FARVAL-NEARVAL,, T_Z,), (0 0 0 1),)
11483 where T_X=-RIGHT+LEFT,/RIGHT-LEFT,, T_Y=-TOP+BOTTOM,/TOP-BOTTOM,,
11484 T_Z=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
11486 Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
11487 and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
11488 that are mapped to the lower left and upper right corners of the window,
11489 respectively, assuming that the eye is located at (0, 0, 0). -FARVAL
11490 specifies the location of the far clipping plane. Both NEARVAL and
11491 FARVAL can be either positive or negative.
11493 Use `glPushMatrix' and `glPopMatrix' to save and restore the current
11496 `GL_INVALID_VALUE' is generated if LEFT = RIGHT, or BOTTOM = TOP, or
11499 `GL_INVALID_OPERATION' is generated if `glOrtho' is executed between the
11500 execution of `glBegin' and the corresponding execution of `glEnd'.")
11502 (define-gl-procedures
11503 ((glPassThrough (token GLfloat) -> void))
11504 "Place a marker in the feedback buffer.
11507 Specifies a marker value to be placed in the feedback buffer
11508 following a `GL_PASS_THROUGH_TOKEN'.
11512 Feedback is a GL render mode. The mode is selected by calling
11513 `glRenderMode' with `GL_FEEDBACK'. When the GL is in feedback mode, no
11514 pixels are produced by rasterization. Instead, information about
11515 primitives that would have been rasterized is fed back to the
11516 application using the GL. See the `glFeedbackBuffer' reference page for
11517 a description of the feedback buffer and the values in it.
11519 `glPassThrough' inserts a user-defined marker in the feedback buffer
11520 when it is executed in feedback mode. TOKEN is returned as if it were a
11521 primitive; it is indicated with its own unique identifying value:
11522 `GL_PASS_THROUGH_TOKEN'. The order of `glPassThrough' commands with
11523 respect to the specification of graphics primitives is maintained.
11525 `GL_INVALID_OPERATION' is generated if `glPassThrough' is executed
11526 between the execution of `glBegin' and the corresponding execution of
11529 (define-gl-procedures
11540 "Set pixel storage modes.
11543 Specifies the symbolic name of the parameter to be set. Six values
11544 affect the packing of pixel data into memory: `GL_PACK_SWAP_BYTES',
11545 `GL_PACK_LSB_FIRST', `GL_PACK_ROW_LENGTH', `GL_PACK_IMAGE_HEIGHT',
11546 `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', `GL_PACK_SKIP_IMAGES',
11547 and `GL_PACK_ALIGNMENT'. Six more affect the unpacking of pixel
11548 data FROM memory: `GL_UNPACK_SWAP_BYTES', `GL_UNPACK_LSB_FIRST',
11549 `GL_UNPACK_ROW_LENGTH', `GL_UNPACK_IMAGE_HEIGHT',
11550 `GL_UNPACK_SKIP_PIXELS', `GL_UNPACK_SKIP_ROWS',
11551 `GL_UNPACK_SKIP_IMAGES', and `GL_UNPACK_ALIGNMENT'.
11554 Specifies the value that PNAME is set to.
11556 `glPixelStore' sets pixel storage modes that affect the operation of
11557 subsequent `glDrawPixels' and `glReadPixels' as well as the unpacking of
11558 polygon stipple patterns (see `glPolygonStipple'), bitmaps (see
11559 `glBitmap'), texture patterns (see `glTexImage1D', `glTexImage2D',
11560 `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
11561 `glTexSubImage3D'). Additionally, if the `ARB_imaging' extension is
11562 supported, pixel storage modes affect convolution filters (see
11563 `glConvolutionFilter1D', `glConvolutionFilter2D', and
11564 `glSeparableFilter2D', color table (see `glColorTable', and
11565 `glColorSubTable', and unpacking histogram (See `glHistogram'), and
11566 minmax (See `glMinmax') data.
11568 PNAME is a symbolic constant indicating the parameter to be set, and
11569 PARAM is the new value. Six of the twelve storage parameters affect how
11570 pixel data is returned to client memory. They are as follows:
11572 `GL_PACK_SWAP_BYTES'
11573 If true, byte ordering for multibyte color components, depth
11574 components, color indices, or stencil indices is reversed. That is,
11575 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
11576 it is stored in memory as B_3 , B_2 , B_1 , B_0 if
11577 `GL_PACK_SWAP_BYTES' is true. `GL_PACK_SWAP_BYTES' has no effect on
11578 the memory order of components within a pixel, only on the order of
11579 bytes within components or indices. For example, the three
11580 components of a `GL_RGB' format pixel are always stored with red
11581 first, green second, and blue third, regardless of the value of
11582 `GL_PACK_SWAP_BYTES'.
11584 `GL_PACK_LSB_FIRST'
11585 If true, bits are ordered within a byte from least significant to
11586 most significant; otherwise, the first bit in each byte is the most
11587 significant one. This parameter is significant for bitmap data
11590 `GL_PACK_ROW_LENGTH'
11591 If greater than 0, `GL_PACK_ROW_LENGTH' defines the number of
11592 pixels in a row. If the first pixel of a row is placed at location
11593 P in memory, then the location of the first pixel of the next row
11594 is obtained by skipping
11596 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
11598 components or indices, where N is the number of components or
11599 indices in a pixel, L is the number of pixels in a row
11600 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11601 to the pixel routine otherwise), A is the value of
11602 `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
11603 component (if A<S , then it is as if A=S ). In the case of 1-bit
11604 values, the location of the next row is obtained by skipping
11606 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
11608 components or indices.
11610 The word COMPONENT in this description refers to the nonindex
11611 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11612 for example, has three components per pixel: first red, then green,
11615 `GL_PACK_IMAGE_HEIGHT'
11616 If greater than 0, `GL_PACK_IMAGE_HEIGHT' defines the number of
11617 pixels in an image three-dimensional texture volume, where
11618 ``image'' is defined by all pixels sharing the same third dimension
11619 index. If the first pixel of a row is placed at location P in
11620 memory, then the location of the first pixel of the next row is
11621 obtained by skipping
11623 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
11625 components or indices, where N is the number of components or
11626 indices in a pixel, L is the number of pixels in a row
11627 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11628 to `glTexImage3D' otherwise), H is the number of rows in a pixel
11629 image (`GL_PACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
11630 argument to the `glTexImage3D' routine otherwise), A is the value
11631 of `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
11632 component (if A<S , then it is as if A=S ).
11634 The word COMPONENT in this description refers to the nonindex
11635 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11636 for example, has three components per pixel: first red, then green,
11639 `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', and `GL_PACK_SKIP_IMAGES'
11640 These values are provided as a convenience to the programmer; they
11641 provide no functionality that cannot be duplicated simply by
11642 incrementing the pointer passed to `glReadPixels'. Setting
11643 `GL_PACK_SKIP_PIXELS' to I is equivalent to incrementing the
11644 pointer by I\u2062N components or indices, where N is the number of
11645 components or indices in each pixel. Setting `GL_PACK_SKIP_ROWS' to
11646 J is equivalent to incrementing the pointer by J\u2062M components or
11647 indices, where M is the number of components or indices per row, as
11648 just computed in the `GL_PACK_ROW_LENGTH' section. Setting
11649 `GL_PACK_SKIP_IMAGES' to K is equivalent to incrementing the
11650 pointer by K\u2062P , where P is the number of components or indices per
11651 image, as computed in the `GL_PACK_IMAGE_HEIGHT' section.
11653 `GL_PACK_ALIGNMENT'
11654 Specifies the alignment requirements for the start of each pixel
11655 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
11656 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
11657 start on double-word boundaries).
11659 The other six of the twelve storage parameters affect how pixel data is
11660 read from client memory. These values are significant for
11661 `glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
11662 `glTexSubImage1D', `glTexSubImage2D', `glTexSubImage3D', `glBitmap', and
11663 `glPolygonStipple'.
11665 Additionally, if the `ARB_imaging' extension is supported,
11666 `glColorTable', `glColorSubTable', `glConvolutionFilter1D',
11667 `glConvolutionFilter2D', and `glSeparableFilter2D'. They are as follows:
11669 `GL_UNPACK_SWAP_BYTES'
11670 If true, byte ordering for multibyte color components, depth
11671 components, color indices, or stencil indices is reversed. That is,
11672 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
11673 it is taken from memory as B_3 , B_2 , B_1 , B_0 if
11674 `GL_UNPACK_SWAP_BYTES' is true. `GL_UNPACK_SWAP_BYTES' has no
11675 effect on the memory order of components within a pixel, only on
11676 the order of bytes within components or indices. For example, the
11677 three components of a `GL_RGB' format pixel are always stored with
11678 red first, green second, and blue third, regardless of the value of
11679 `GL_UNPACK_SWAP_BYTES'.
11681 `GL_UNPACK_LSB_FIRST'
11682 If true, bits are ordered within a byte from least significant to
11683 most significant; otherwise, the first bit in each byte is the most
11684 significant one. This is relevant only for bitmap data.
11686 `GL_UNPACK_ROW_LENGTH'
11687 If greater than 0, `GL_UNPACK_ROW_LENGTH' defines the number of
11688 pixels in a row. If the first pixel of a row is placed at location
11689 P in memory, then the location of the first pixel of the next row
11690 is obtained by skipping
11692 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
11694 components or indices, where N is the number of components or
11695 indices in a pixel, L is the number of pixels in a row
11696 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11697 to the pixel routine otherwise), A is the value of
11698 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
11699 component (if A<S , then it is as if A=S ). In the case of 1-bit
11700 values, the location of the next row is obtained by skipping
11702 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
11704 components or indices.
11706 The word COMPONENT in this description refers to the nonindex
11707 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11708 for example, has three components per pixel: first red, then green,
11711 `GL_UNPACK_IMAGE_HEIGHT'
11712 If greater than 0, `GL_UNPACK_IMAGE_HEIGHT' defines the number of
11713 pixels in an image of a three-dimensional texture volume. Where
11714 ``image'' is defined by all pixel sharing the same third dimension
11715 index. If the first pixel of a row is placed at location P in
11716 memory, then the location of the first pixel of the next row is
11717 obtained by skipping
11719 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
11721 components or indices, where N is the number of components or
11722 indices in a pixel, L is the number of pixels in a row
11723 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11724 to `glTexImage3D' otherwise), H is the number of rows in an image
11725 (`GL_UNPACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
11726 argument to `glTexImage3D' otherwise), A is the value of
11727 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
11728 component (if A<S , then it is as if A=S ).
11730 The word COMPONENT in this description refers to the nonindex
11731 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11732 for example, has three components per pixel: first red, then green,
11735 `GL_UNPACK_SKIP_PIXELS' and `GL_UNPACK_SKIP_ROWS'
11736 These values are provided as a convenience to the programmer; they
11737 provide no functionality that cannot be duplicated by incrementing
11738 the pointer passed to `glDrawPixels', `glTexImage1D',
11739 `glTexImage2D', `glTexSubImage1D', `glTexSubImage2D', `glBitmap',
11740 or `glPolygonStipple'. Setting `GL_UNPACK_SKIP_PIXELS' to I is
11741 equivalent to incrementing the pointer by I\u2062N components or
11742 indices, where N is the number of components or indices in each
11743 pixel. Setting `GL_UNPACK_SKIP_ROWS' to J is equivalent to
11744 incrementing the pointer by J\u2062K components or indices, where K is
11745 the number of components or indices per row, as just computed in
11746 the `GL_UNPACK_ROW_LENGTH' section.
11748 `GL_UNPACK_ALIGNMENT'
11749 Specifies the alignment requirements for the start of each pixel
11750 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
11751 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
11752 start on double-word boundaries).
11754 The following table gives the type, initial value, and range of valid
11755 values for each storage parameter that can be set with `glPixelStore'.
11760 *Type*, *Initial Value*, *Valid Range*
11762 `GL_PACK_SWAP_BYTES'
11763 boolean , false , true or false
11765 `GL_PACK_LSB_FIRST'
11766 boolean , false , true or false
11768 `GL_PACK_ROW_LENGTH'
11769 integer , 0 , [0,∞)
11771 `GL_PACK_IMAGE_HEIGHT'
11772 integer , 0 , [0,∞)
11774 `GL_PACK_SKIP_ROWS'
11775 integer , 0 , [0,∞)
11777 `GL_PACK_SKIP_PIXELS'
11778 integer , 0 , [0,∞)
11780 `GL_PACK_SKIP_IMAGES'
11781 integer , 0 , [0,∞)
11783 `GL_PACK_ALIGNMENT'
11784 integer , 4 , 1, 2, 4, or 8
11786 `GL_UNPACK_SWAP_BYTES'
11787 boolean , false , true or false
11789 `GL_UNPACK_LSB_FIRST'
11790 boolean , false , true or false
11792 `GL_UNPACK_ROW_LENGTH'
11793 integer , 0 , [0,∞)
11795 `GL_UNPACK_IMAGE_HEIGHT'
11796 integer , 0 , [0,∞)
11798 `GL_UNPACK_SKIP_ROWS'
11799 integer , 0 , [0,∞)
11801 `GL_UNPACK_SKIP_PIXELS'
11802 integer , 0 , [0,∞)
11804 `GL_UNPACK_SKIP_IMAGES'
11805 integer , 0 , [0,∞)
11807 `GL_UNPACK_ALIGNMENT'
11808 integer , 4 , 1, 2, 4, or 8
11810 `glPixelStoref' can be used to set any pixel store parameter. If the
11811 parameter type is boolean, then if PARAM is 0, the parameter is false;
11812 otherwise it is set to true. If PNAME is a integer type parameter, PARAM
11813 is rounded to the nearest integer.
11815 Likewise, `glPixelStorei' can also be used to set any of the pixel store
11816 parameters. Boolean parameters are set to false if PARAM is 0 and true
11819 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
11821 `GL_INVALID_VALUE' is generated if a negative row length, pixel skip, or
11822 row skip value is specified, or if alignment is specified as other than
11825 `GL_INVALID_OPERATION' is generated if `glPixelStore' is executed
11826 between the execution of `glBegin' and the corresponding execution of
11829 (define-gl-procedures
11840 "Set pixel transfer modes.
11843 Specifies the symbolic name of the pixel transfer parameter to be
11844 set. Must be one of the following: `GL_MAP_COLOR',
11845 `GL_MAP_STENCIL', `GL_INDEX_SHIFT', `GL_INDEX_OFFSET',
11846 `GL_RED_SCALE', `GL_RED_BIAS', `GL_GREEN_SCALE', `GL_GREEN_BIAS',
11847 `GL_BLUE_SCALE', `GL_BLUE_BIAS', `GL_ALPHA_SCALE', `GL_ALPHA_BIAS',
11848 `GL_DEPTH_SCALE', or `GL_DEPTH_BIAS'.
11850 Additionally, if the `ARB_imaging' extension is supported, the
11851 following symbolic names are accepted:
11852 `GL_POST_COLOR_MATRIX_RED_SCALE',
11853 `GL_POST_COLOR_MATRIX_GREEN_SCALE',
11854 `GL_POST_COLOR_MATRIX_BLUE_SCALE',
11855 `GL_POST_COLOR_MATRIX_ALPHA_SCALE',
11856 `GL_POST_COLOR_MATRIX_RED_BIAS', `GL_POST_COLOR_MATRIX_GREEN_BIAS',
11857 `GL_POST_COLOR_MATRIX_BLUE_BIAS',
11858 `GL_POST_COLOR_MATRIX_ALPHA_BIAS', `GL_POST_CONVOLUTION_RED_SCALE',
11859 `GL_POST_CONVOLUTION_GREEN_SCALE',
11860 `GL_POST_CONVOLUTION_BLUE_SCALE',
11861 `GL_POST_CONVOLUTION_ALPHA_SCALE', `GL_POST_CONVOLUTION_RED_BIAS',
11862 `GL_POST_CONVOLUTION_GREEN_BIAS', `GL_POST_CONVOLUTION_BLUE_BIAS',
11863 and `GL_POST_CONVOLUTION_ALPHA_BIAS'.
11866 Specifies the value that PNAME is set to.
11868 `glPixelTransfer' sets pixel transfer modes that affect the operation of
11869 subsequent `glCopyPixels', `glCopyTexImage1D', `glCopyTexImage2D',
11870 `glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D',
11871 `glDrawPixels', `glReadPixels', `glTexImage1D', `glTexImage2D',
11872 `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', and
11873 `glTexSubImage3D' commands. Additionally, if the `ARB_imaging' subset is
11874 supported, the routines `glColorTable', `glColorSubTable',
11875 `glConvolutionFilter1D', `glConvolutionFilter2D', `glHistogram',
11876 `glMinmax', and `glSeparableFilter2D' are also affected. The algorithms
11877 that are specified by pixel transfer modes operate on pixels after they
11878 are read from the frame buffer (`glCopyPixels'`glCopyTexImage1D',
11879 `glCopyTexImage2D', `glCopyTexSubImage1D', `glCopyTexSubImage2D',
11880 `glCopyTexSubImage3D', and `glReadPixels'), or unpacked from client
11881 memory (`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
11882 `glTexSubImage1D', `glTexSubImage2D', and `glTexSubImage3D'). Pixel
11883 transfer operations happen in the same order, and in the same manner,
11884 regardless of the command that resulted in the pixel operation. Pixel
11885 storage modes (see `glPixelStore') control the unpacking of pixels being
11886 read from client memory and the packing of pixels being written back
11887 into client memory.
11889 Pixel transfer operations handle four fundamental pixel types: COLOR,
11890 COLOR INDEX, DEPTH, and STENCIL. COLOR pixels consist of four
11891 floating-point values with unspecified mantissa and exponent sizes,
11892 scaled such that 0 represents zero intensity and 1 represents full
11893 intensity. COLOR INDICES comprise a single fixed-point value, with
11894 unspecified precision to the right of the binary point. DEPTH pixels
11895 comprise a single floating-point value, with unspecified mantissa and
11896 exponent sizes, scaled such that 0.0 represents the minimum depth buffer
11897 value, and 1.0 represents the maximum depth buffer value. Finally,
11898 STENCIL pixels comprise a single fixed-point value, with unspecified
11899 precision to the right of the binary point.
11901 The pixel transfer operations performed on the four basic pixel types
11905 Each of the four color components is multiplied by a scale factor,
11906 then added to a bias factor. That is, the red component is
11907 multiplied by `GL_RED_SCALE', then added to `GL_RED_BIAS'; the
11908 green component is multiplied by `GL_GREEN_SCALE', then added to
11909 `GL_GREEN_BIAS'; the blue component is multiplied by
11910 `GL_BLUE_SCALE', then added to `GL_BLUE_BIAS'; and the alpha
11911 component is multiplied by `GL_ALPHA_SCALE', then added to
11912 `GL_ALPHA_BIAS'. After all four color components are scaled and
11913 biased, each is clamped to the range [0,1] . All color, scale, and
11914 bias values are specified with `glPixelTransfer'.
11916 If `GL_MAP_COLOR' is true, each color component is scaled by the
11917 size of the corresponding color-to-color map, then replaced by the
11918 contents of that map indexed by the scaled component. That is, the
11919 red component is scaled by `GL_PIXEL_MAP_R_TO_R_SIZE', then
11920 replaced by the contents of `GL_PIXEL_MAP_R_TO_R' indexed by
11921 itself. The green component is scaled by
11922 `GL_PIXEL_MAP_G_TO_G_SIZE', then replaced by the contents of
11923 `GL_PIXEL_MAP_G_TO_G' indexed by itself. The blue component is
11924 scaled by `GL_PIXEL_MAP_B_TO_B_SIZE', then replaced by the contents
11925 of `GL_PIXEL_MAP_B_TO_B' indexed by itself. And the alpha component
11926 is scaled by `GL_PIXEL_MAP_A_TO_A_SIZE', then replaced by the
11927 contents of `GL_PIXEL_MAP_A_TO_A' indexed by itself. All components
11928 taken from the maps are then clamped to the range [0,1] .
11929 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
11930 the various maps are specified with `glPixelMap'.
11932 If the `ARB_imaging' extension is supported, each of the four color
11933 components may be scaled and biased after transformation by the
11934 color matrix. That is, the red component is multiplied by
11935 `GL_POST_COLOR_MATRIX_RED_SCALE', then added to
11936 `GL_POST_COLOR_MATRIX_RED_BIAS'; the green component is multiplied
11937 by `GL_POST_COLOR_MATRIX_GREEN_SCALE', then added to
11938 `GL_POST_COLOR_MATRIX_GREEN_BIAS'; the blue component is multiplied
11939 by `GL_POST_COLOR_MATRIX_BLUE_SCALE', then added to
11940 `GL_POST_COLOR_MATRIX_BLUE_BIAS'; and the alpha component is
11941 multiplied by `GL_POST_COLOR_MATRIX_ALPHA_SCALE', then added to
11942 `GL_POST_COLOR_MATRIX_ALPHA_BIAS'. After all four color components
11943 are scaled and biased, each is clamped to the range [0,1] .
11945 Similarly, if the `ARB_imaging' extension is supported, each of the
11946 four color components may be scaled and biased after processing by
11947 the enabled convolution filter. That is, the red component is
11948 multiplied by `GL_POST_CONVOLUTION_RED_SCALE', then added to
11949 `GL_POST_CONVOLUTION_RED_BIAS'; the green component is multiplied
11950 by `GL_POST_CONVOLUTION_GREEN_SCALE', then added to
11951 `GL_POST_CONVOLUTION_GREEN_BIAS'; the blue component is multiplied
11952 by `GL_POST_CONVOLUTION_BLUE_SCALE', then added to
11953 `GL_POST_CONVOLUTION_BLUE_BIAS'; and the alpha component is
11954 multiplied by `GL_POST_CONVOLUTION_ALPHA_SCALE', then added to
11955 `GL_POST_CONVOLUTION_ALPHA_BIAS'. After all four color components
11956 are scaled and biased, each is clamped to the range [0,1] .
11959 Each color index is shifted left by `GL_INDEX_SHIFT' bits; any bits
11960 beyond the number of fraction bits carried by the fixed-point index
11961 are filled with zeros. If `GL_INDEX_SHIFT' is negative, the shift
11962 is to the right, again zero filled. Then `GL_INDEX_OFFSET' is added
11963 to the index. `GL_INDEX_SHIFT' and `GL_INDEX_OFFSET' are specified
11964 with `glPixelTransfer'.
11966 From this point, operation diverges depending on the required
11967 format of the resulting pixels. If the resulting pixels are to be
11968 written to a color index buffer, or if they are being read back to
11969 client memory in `GL_COLOR_INDEX' format, the pixels continue to be
11970 treated as indices. If `GL_MAP_COLOR' is true, each index is masked
11971 by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_I_SIZE', then replaced by
11972 the contents of `GL_PIXEL_MAP_I_TO_I' indexed by the masked value.
11973 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
11974 the index map is specified with `glPixelMap'.
11976 If the resulting pixels are to be written to an RGBA color buffer,
11977 or if they are read back to client memory in a format other than
11978 `GL_COLOR_INDEX', the pixels are converted from indices to colors
11979 by referencing the four maps `GL_PIXEL_MAP_I_TO_R',
11980 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
11981 `GL_PIXEL_MAP_I_TO_A'. Before being dereferenced, the index is
11982 masked by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_R_SIZE' for the red
11983 map, `GL_PIXEL_MAP_I_TO_G_SIZE' for the green map,
11984 `GL_PIXEL_MAP_I_TO_B_SIZE' for the blue map, and
11985 `GL_PIXEL_MAP_I_TO_A_SIZE' for the alpha map. All components taken
11986 from the maps are then clamped to the range [0,1] . The contents of
11987 the four maps is specified with `glPixelMap'.
11990 Each depth value is multiplied by `GL_DEPTH_SCALE', added to
11991 `GL_DEPTH_BIAS', then clamped to the range [0,1] .
11994 Each index is shifted `GL_INDEX_SHIFT' bits just as a color index
11995 is, then added to `GL_INDEX_OFFSET'. If `GL_MAP_STENCIL' is true,
11996 each index is masked by 2^N-1 , where N is
11997 `GL_PIXEL_MAP_S_TO_S_SIZE', then replaced by the contents of
11998 `GL_PIXEL_MAP_S_TO_S' indexed by the masked value.
12000 The following table gives the type, initial value, and range of valid
12001 values for each of the pixel transfer parameters that are set with
12007 *Type*, *Initial Value*, *Valid Range*
12010 boolean , false , true/false
12013 boolean , false , true/false
12016 integer , 0 , (-∞,∞)
12019 integer , 0 , (-∞,∞)
12051 `GL_POST_COLOR_MATRIX_RED_SCALE'
12054 `GL_POST_COLOR_MATRIX_GREEN_SCALE'
12057 `GL_POST_COLOR_MATRIX_BLUE_SCALE'
12060 `GL_POST_COLOR_MATRIX_ALPHA_SCALE'
12063 `GL_POST_COLOR_MATRIX_RED_BIAS'
12066 `GL_POST_COLOR_MATRIX_GREEN_BIAS'
12069 `GL_POST_COLOR_MATRIX_BLUE_BIAS'
12072 `GL_POST_COLOR_MATRIX_ALPHA_BIAS'
12075 `GL_POST_CONVOLUTION_RED_SCALE'
12078 `GL_POST_CONVOLUTION_GREEN_SCALE'
12081 `GL_POST_CONVOLUTION_BLUE_SCALE'
12084 `GL_POST_CONVOLUTION_ALPHA_SCALE'
12087 `GL_POST_CONVOLUTION_RED_BIAS'
12090 `GL_POST_CONVOLUTION_GREEN_BIAS'
12093 `GL_POST_CONVOLUTION_BLUE_BIAS'
12096 `GL_POST_CONVOLUTION_ALPHA_BIAS'
12099 `glPixelTransferf' can be used to set any pixel transfer parameter. If
12100 the parameter type is boolean, 0 implies false and any other value
12101 implies true. If PNAME is an integer parameter, PARAM is rounded to the
12104 Likewise, `glPixelTransferi' can be used to set any of the pixel
12105 transfer parameters. Boolean parameters are set to false if PARAM is 0
12106 and to true otherwise. PARAM is converted to floating point before being
12107 assigned to real-valued parameters.
12109 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
12111 `GL_INVALID_OPERATION' is generated if `glPixelTransfer' is executed
12112 between the execution of `glBegin' and the corresponding execution of
12115 (define-gl-procedures
12121 "Specify the pixel zoom factors.
12126 Specify the X and Y zoom factors for pixel write operations.
12128 `glPixelZoom' specifies values for the X and Y zoom factors. During the
12129 execution of `glDrawPixels' or `glCopyPixels', if (XR , YR ) is the
12130 current raster position, and a given element is in the M th row and N th
12131 column of the pixel rectangle, then pixels whose centers are in the
12132 rectangle with corners at
12134 (XR+N·XFACTOR , YR+M·YFACTOR )
12136 (XR+(N+1,)·XFACTOR , YR+(M+1,)·YFACTOR )
12138 are candidates for replacement. Any pixel whose center lies on the
12139 bottom or left edge of this rectangular region is also modified.
12141 Pixel zoom factors are not limited to positive values. Negative zoom
12142 factors reflect the resulting image about the current raster position.
12144 `GL_INVALID_OPERATION' is generated if `glPixelZoom' is executed between
12145 the execution of `glBegin' and the corresponding execution of `glEnd'.")
12147 (define-gl-procedures
12148 ((glPointParameterf
12158 "Specify point parameters.
12161 Specifies a single-valued point parameter. `GL_POINT_SIZE_MIN',
12162 `GL_POINT_SIZE_MAX', `GL_POINT_FADE_THRESHOLD_SIZE', and
12163 `GL_POINT_SPRITE_COORD_ORIGIN' are accepted.
12166 Specifies the value that PNAME will be set to.
12168 The following values are accepted for PNAME:
12170 `GL_POINT_SIZE_MIN'
12173 PARAMS is a single floating-point value that specifies the minimum
12174 point size. The default value is 0.0.
12176 `GL_POINT_SIZE_MAX'
12179 PARAMS is a single floating-point value that specifies the maximum
12180 point size. The default value is 1.0.
12182 `GL_POINT_FADE_THRESHOLD_SIZE'
12185 PARAMS is a single floating-point value that specifies the
12186 threshold value to which point sizes are clamped if they exceed the
12187 specified value. The default value is 1.0.
12189 `GL_POINT_DISTANCE_ATTENUATION'
12192 PARAMS is an array of three floating-point values that specify the
12193 coefficients used for scaling the computed point size. The default
12194 values are (1,00) .
12196 `GL_POINT_SPRITE_COORD_ORIGIN'
12199 PARAMS is a single enum specifying the point sprite texture
12200 coordinate origin, either `GL_LOWER_LEFT' or `GL_UPPER_LEFT'. The
12201 default value is `GL_UPPER_LEFT'.
12203 `GL_INVALID_VALUE' is generated If the value specified for
12204 `GL_POINT_SIZE_MIN', `GL_POINT_SIZE_MAX', or
12205 `GL_POINT_FADE_THRESHOLD_SIZE' is less than zero.
12207 `GL_INVALID_ENUM' is generated If the value specified for
12208 `GL_POINT_SPRITE_COORD_ORIGIN' is not `GL_LOWER_LEFT' or
12211 If the value for `GL_POINT_SIZE_MIN' is greater than
12212 `GL_POINT_SIZE_MAX', the point size after clamping is undefined, but no
12213 error is generated.")
12215 (define-gl-procedures
12216 ((glPointSize (size GLfloat) -> void))
12217 "Specify the diameter of rasterized points.
12220 Specifies the diameter of rasterized points. The initial value is
12223 `glPointSize' specifies the rasterized diameter of both aliased and
12224 antialiased points. Using a point size other than 1 has different
12225 effects, depending on whether point antialiasing is enabled. To enable
12226 and disable point antialiasing, call `glEnable' and `glDisable' with
12227 argument `GL_POINT_SMOOTH'. Point antialiasing is initially disabled.
12229 The specified point size is multiplied with a distance attenuation
12230 factor and clamped to the specified point size range, and further
12231 clamped to the implementation-dependent point size range to produce the
12232 derived point size using
12234 POINTSIZE=CLAMP\u2062(SIZE×√(1/A+B×D+C×D^2,,,),,)
12236 where D is the eye-coordinate distance from the eye to the vertex, and A
12237 , B , and C are the distance attenuation coefficients (see
12238 `glPointParameter').
12240 If multisampling is disabled, the computed point size is used as the
12243 If multisampling is enabled, the point may be faded by modifying the
12244 point alpha value (see `glSampleCoverage') instead of allowing the point
12245 width to go below a given threshold (see `glPointParameter'). In this
12246 case, the width is further modified in the following manner:
12248 POINTWIDTH={(POINTSIZE), (THRESHOLD)\u2062(POINTSIZE>=THRESHOLD),
12251 The point alpha value is modified by computing:
12253 POINTALPHA={(1), ((POINTSIZE/THRESHOLD,)^2)\u2062(POINTSIZE>=THRESHOLD),
12256 If point antialiasing is disabled, the actual size is determined by
12257 rounding the supplied size to the nearest integer. (If the rounding
12258 results in the value 0, it is as if the point size were 1.) If the
12259 rounded size is odd, then the center point (X , Y ) of the pixel
12260 fragment that represents the point is computed as
12262 (⌊X_W,⌋+.5,⌊Y_W,⌋+.5)
12264 where W subscripts indicate window coordinates. All pixels that lie
12265 within the square grid of the rounded size centered at (X , Y ) make up
12266 the fragment. If the size is even, the center point is
12268 (⌊X_W+.5,⌋,⌊Y_W+.5,⌋)
12270 and the rasterized fragment's centers are the half-integer window
12271 coordinates within the square of the rounded size centered at (X,Y) .
12272 All pixel fragments produced in rasterizing a nonantialiased point are
12273 assigned the same associated data, that of the vertex corresponding to
12276 If antialiasing is enabled, then point rasterization produces a fragment
12277 for each pixel square that intersects the region lying within the circle
12278 having diameter equal to the current point size and centered at the
12279 point's (X_W,Y_W) . The coverage value for each fragment is the window
12280 coordinate area of the intersection of the circular region with the
12281 corresponding pixel square. This value is saved and used in the final
12282 rasterization step. The data associated with each fragment is the data
12283 associated with the point being rasterized.
12285 Not all sizes are supported when point antialiasing is enabled. If an
12286 unsupported size is requested, the nearest supported size is used. Only
12287 size 1 is guaranteed to be supported; others depend on the
12288 implementation. To query the range of supported sizes and the size
12289 difference between supported sizes within the range, call `glGet' with
12290 arguments `GL_SMOOTH_POINT_SIZE_RANGE' and
12291 `GL_SMOOTH_POINT_SIZE_GRANULARITY'. For aliased points, query the
12292 supported ranges and granularity with `glGet' with arguments
12293 `GL_ALIASED_POINT_SIZE_RANGE'.
12295 `GL_INVALID_VALUE' is generated if SIZE is less than or equal to 0.
12297 `GL_INVALID_OPERATION' is generated if `glPointSize' is executed between
12298 the execution of `glBegin' and the corresponding execution of `glEnd'.")
12300 (define-gl-procedures
12306 "Select a polygon rasterization mode.
12309 Specifies the polygons that MODE applies to. Must be `GL_FRONT' for
12310 front-facing polygons, `GL_BACK' for back-facing polygons, or
12311 `GL_FRONT_AND_BACK' for front- and back-facing polygons.
12314 Specifies how polygons will be rasterized. Accepted values are
12315 `GL_POINT', `GL_LINE', and `GL_FILL'. The initial value is
12316 `GL_FILL' for both front- and back-facing polygons.
12318 `glPolygonMode' controls the interpretation of polygons for
12319 rasterization. FACE describes which polygons MODE applies to:
12320 front-facing polygons (`GL_FRONT'), back-facing polygons (`GL_BACK'), or
12321 both (`GL_FRONT_AND_BACK'). The polygon mode affects only the final
12322 rasterization of polygons. In particular, a polygon's vertices are lit
12323 and the polygon is clipped and possibly culled before these modes are
12326 Three modes are defined and can be specified in MODE:
12329 Polygon vertices that are marked as the start of a boundary edge
12330 are drawn as points. Point attributes such as `GL_POINT_SIZE' and
12331 `GL_POINT_SMOOTH' control the rasterization of the points. Polygon
12332 rasterization attributes other than `GL_POLYGON_MODE' have no
12336 Boundary edges of the polygon are drawn as line segments. They are
12337 treated as connected line segments for line stippling; the line
12338 stipple counter and pattern are not reset between segments (see
12339 `glLineStipple'). Line attributes such as `GL_LINE_WIDTH' and
12340 `GL_LINE_SMOOTH' control the rasterization of the lines. Polygon
12341 rasterization attributes other than `GL_POLYGON_MODE' have no
12345 The interior of the polygon is filled. Polygon attributes such as
12346 `GL_POLYGON_STIPPLE' and `GL_POLYGON_SMOOTH' control the
12347 rasterization of the polygon.
12349 `GL_INVALID_ENUM' is generated if either FACE or MODE is not an accepted
12352 `GL_INVALID_OPERATION' is generated if `glPolygonMode' is executed
12353 between the execution of `glBegin' and the corresponding execution of
12356 (define-gl-procedures
12362 "Set the scale and units used to calculate depth values.
12365 Specifies a scale factor that is used to create a variable depth
12366 offset for each polygon. The initial value is 0.
12369 Is multiplied by an implementation-specific value to create a
12370 constant depth offset. The initial value is 0.
12372 When `GL_POLYGON_OFFSET_FILL', `GL_POLYGON_OFFSET_LINE', or
12373 `GL_POLYGON_OFFSET_POINT' is enabled, each fragment's DEPTH value will
12374 be offset after it is interpolated from the DEPTH values of the
12375 appropriate vertices. The value of the offset is FACTOR×DZ+R×UNITS ,
12376 where DZ is a measurement of the change in depth relative to the screen
12377 area of the polygon, and R is the smallest value that is guaranteed to
12378 produce a resolvable offset for a given implementation. The offset is
12379 added before the depth test is performed and before the value is written
12380 into the depth buffer.
12382 `glPolygonOffset' is useful for rendering hidden-line images, for
12383 applying decals to surfaces, and for rendering solids with highlighted
12386 `GL_INVALID_OPERATION' is generated if `glPolygonOffset' is executed
12387 between the execution of `glBegin' and the corresponding execution of
12390 (define-gl-procedures
12392 (pattern const-GLubyte-*)
12395 "Set the polygon stippling pattern.
12398 Specifies a pointer to a 32×32 stipple pattern that will be
12399 unpacked from memory in the same way that `glDrawPixels' unpacks
12402 Polygon stippling, like line stippling (see `glLineStipple'), masks out
12403 certain fragments produced by rasterization, creating a pattern.
12404 Stippling is independent of polygon antialiasing.
12406 PATTERN is a pointer to a 32×32 stipple pattern that is stored in memory
12407 just like the pixel data supplied to a `glDrawPixels' call with height
12408 and WIDTH both equal to 32, a pixel format of `GL_COLOR_INDEX', and data
12409 type of `GL_BITMAP'. That is, the stipple pattern is represented as a
12410 32×32 array of 1-bit color indices packed in unsigned bytes.
12411 `glPixelStore' parameters like `GL_UNPACK_SWAP_BYTES' and
12412 `GL_UNPACK_LSB_FIRST' affect the assembling of the bits into a stipple
12413 pattern. Pixel transfer operations (shift, offset, pixel map) are not
12414 applied to the stipple image, however.
12416 If a non-zero named buffer object is bound to the
12417 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a stipple
12418 pattern is specified, PATTERN is treated as a byte offset into the
12419 buffer object's data store.
12421 To enable and disable polygon stippling, call `glEnable' and `glDisable'
12422 with argument `GL_POLYGON_STIPPLE'. Polygon stippling is initially
12423 disabled. If it's enabled, a rasterized polygon fragment with window
12424 coordinates X_W and Y_W is sent to the next stage of the GL if and only
12425 if the (X_W%32 )th bit in the (Y_W%32 )th row of the stipple pattern is
12426 1 (one). When polygon stippling is disabled, it is as if the stipple
12427 pattern consists of all 1's.
12429 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
12430 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
12431 data store is currently mapped.
12433 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
12434 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
12435 unpacked from the buffer object such that the memory reads required
12436 would exceed the data store size.
12438 `GL_INVALID_OPERATION' is generated if `glPolygonStipple' is executed
12439 between the execution of `glBegin' and the corresponding execution of
12442 (define-gl-procedures
12443 ((glPrioritizeTextures
12445 (textures const-GLuint-*)
12446 (priorities const-GLclampf-*)
12449 "Set texture residence priority.
12452 Specifies the number of textures to be prioritized.
12455 Specifies an array containing the names of the textures to be
12459 Specifies an array containing the texture priorities. A priority
12460 given in an element of PRIORITIES applies to the texture named by
12461 the corresponding element of TEXTURES.
12463 `glPrioritizeTextures' assigns the N texture priorities given in
12464 PRIORITIES to the N textures named in TEXTURES.
12466 The GL establishes a ``working set'' of textures that are resident in
12467 texture memory. These textures may be bound to a texture target much
12468 more efficiently than textures that are not resident. By specifying a
12469 priority for each texture, `glPrioritizeTextures' allows applications to
12470 guide the GL implementation in determining which textures should be
12473 The priorities given in PRIORITIES are clamped to the range [0,1] before
12474 they are assigned. 0 indicates the lowest priority; textures with
12475 priority 0 are least likely to be resident. 1 indicates the highest
12476 priority; textures with priority 1 are most likely to be resident.
12477 However, textures are not guaranteed to be resident until they are used.
12479 `glPrioritizeTextures' silently ignores attempts to prioritize texture 0
12480 or any texture name that does not correspond to an existing texture.
12482 `glPrioritizeTextures' does not require that any of the textures named
12483 by TEXTURES be bound to a texture target. `glTexParameter' may also be
12484 used to set a texture's priority, but only if the texture is currently
12485 bound. This is the only way to set the priority of a default texture.
12487 `GL_INVALID_VALUE' is generated if N is negative.
12489 `GL_INVALID_OPERATION' is generated if `glPrioritizeTextures' is
12490 executed between the execution of `glBegin' and the corresponding
12491 execution of `glEnd'.")
12493 (define-gl-procedures
12494 ((glPushAttrib (mask GLbitfield) -> void)
12495 (glPopAttrib -> void))
12496 "Push and pop the server attribute stack.
12499 Specifies a mask that indicates which attributes to save. Values
12500 for MASK are listed below.
12502 `glPushAttrib' takes one argument, a mask that indicates which groups of
12503 state variables to save on the attribute stack. Symbolic constants are
12504 used to set bits in the mask. MASK is typically constructed by
12505 specifying the bitwise-or of several of these constants together. The
12506 special mask `GL_ALL_ATTRIB_BITS' can be used to save all stackable
12509 The symbolic mask constants and their associated GL state are as follows
12510 (the second column lists which attributes are saved):
12514 `GL_ACCUM_BUFFER_BIT'
12515 Accumulation buffer clear value
12517 `GL_COLOR_BUFFER_BIT'
12518 `GL_ALPHA_TEST' enable bit
12521 Alpha test function and reference value
12524 `GL_BLEND' enable bit
12527 Blending source and destination functions
12530 Constant blend color
12536 `GL_DITHER' enable bit
12539 `GL_DRAW_BUFFER' setting
12542 `GL_COLOR_LOGIC_OP' enable bit
12545 `GL_INDEX_LOGIC_OP' enable bit
12551 Color mode and index mode clear values
12554 Color mode and index mode writemasks
12560 Current color index
12563 Current normal vector
12566 Current texture coordinates
12569 Current raster position
12572 `GL_CURRENT_RASTER_POSITION_VALID' flag
12575 RGBA color associated with current raster position
12578 Color index associated with current raster position
12581 Texture coordinates associated with current raster position
12584 `GL_EDGE_FLAG' flag
12586 `GL_DEPTH_BUFFER_BIT'
12587 `GL_DEPTH_TEST' enable bit
12590 Depth buffer test function
12593 Depth buffer clear value
12596 `GL_DEPTH_WRITEMASK' enable bit
12599 `GL_ALPHA_TEST' flag
12602 `GL_AUTO_NORMAL' flag
12608 Enable bits for the user-definable clipping planes
12611 `GL_COLOR_MATERIAL'
12614 `GL_CULL_FACE' flag
12617 `GL_DEPTH_TEST' flag
12626 `GL_LIGHT'I where `0' <= I < `GL_MAX_LIGHTS'
12632 `GL_LINE_SMOOTH' flag
12635 `GL_LINE_STIPPLE' flag
12638 `GL_COLOR_LOGIC_OP' flag
12641 `GL_INDEX_LOGIC_OP' flag
12644 `GL_MAP1_'X where X is a map type
12647 `GL_MAP2_'X where X is a map type
12650 `GL_MULTISAMPLE' flag
12653 `GL_NORMALIZE' flag
12656 `GL_POINT_SMOOTH' flag
12659 `GL_POLYGON_OFFSET_LINE' flag
12662 `GL_POLYGON_OFFSET_FILL' flag
12665 `GL_POLYGON_OFFSET_POINT' flag
12668 `GL_POLYGON_SMOOTH' flag
12671 `GL_POLYGON_STIPPLE' flag
12674 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
12677 `GL_SAMPLE_ALPHA_TO_ONE' flag
12680 `GL_SAMPLE_COVERAGE' flag
12683 `GL_SCISSOR_TEST' flag
12686 `GL_STENCIL_TEST' flag
12689 `GL_TEXTURE_1D' flag
12692 `GL_TEXTURE_2D' flag
12695 `GL_TEXTURE_3D' flag
12698 Flags `GL_TEXTURE_GEN_'X where X is S, T, R, or Q
12701 `GL_MAP1_'X enable bits, where X is a map type
12704 `GL_MAP2_'X enable bits, where X is a map type
12707 1D grid endpoints and divisions
12710 2D grid endpoints and divisions
12713 `GL_AUTO_NORMAL' enable bit
12716 `GL_FOG' enable bit
12734 `GL_FOG_MODE' value
12737 `GL_PERSPECTIVE_CORRECTION_HINT' setting
12740 `GL_POINT_SMOOTH_HINT' setting
12743 `GL_LINE_SMOOTH_HINT' setting
12746 `GL_POLYGON_SMOOTH_HINT' setting
12749 `GL_FOG_HINT' setting
12752 `GL_GENERATE_MIPMAP_HINT' setting
12755 `GL_TEXTURE_COMPRESSION_HINT' setting
12758 `GL_COLOR_MATERIAL' enable bit
12761 `GL_COLOR_MATERIAL_FACE' value
12764 Color material parameters that are tracking the current color
12767 Ambient scene color
12770 `GL_LIGHT_MODEL_LOCAL_VIEWER' value
12773 `GL_LIGHT_MODEL_TWO_SIDE' setting
12776 `GL_LIGHTING' enable bit
12779 Enable bit for each light
12782 Ambient, diffuse, and specular intensity for each light
12785 Direction, position, exponent, and cutoff angle for each light
12788 Constant, linear, and quadratic attenuation factors for each light
12791 Ambient, diffuse, specular, and emissive color for each material
12794 Ambient, diffuse, and specular color indices for each material
12797 Specular exponent for each material
12800 `GL_SHADE_MODEL' setting
12803 `GL_LINE_SMOOTH' flag
12806 `GL_LINE_STIPPLE' enable bit
12809 Line stipple pattern and repeat counter
12815 `GL_LIST_BASE' setting
12817 `GL_MULTISAMPLE_BIT'
12818 `GL_MULTISAMPLE' flag
12821 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
12824 `GL_SAMPLE_ALPHA_TO_ONE' flag
12827 `GL_SAMPLE_COVERAGE' flag
12830 `GL_SAMPLE_COVERAGE_VALUE' value
12833 `GL_SAMPLE_COVERAGE_INVERT' value
12835 `GL_PIXEL_MODE_BIT'
12836 `GL_RED_BIAS' and `GL_RED_SCALE' settings
12839 `GL_GREEN_BIAS' and `GL_GREEN_SCALE' values
12842 `GL_BLUE_BIAS' and `GL_BLUE_SCALE'
12845 `GL_ALPHA_BIAS' and `GL_ALPHA_SCALE'
12848 `GL_DEPTH_BIAS' and `GL_DEPTH_SCALE'
12851 `GL_INDEX_OFFSET' and `GL_INDEX_SHIFT' values
12854 `GL_MAP_COLOR' and `GL_MAP_STENCIL' flags
12857 `GL_ZOOM_X' and `GL_ZOOM_Y' factors
12860 `GL_READ_BUFFER' setting
12863 `GL_POINT_SMOOTH' flag
12869 `GL_CULL_FACE' enable bit
12872 `GL_CULL_FACE_MODE' value
12875 `GL_FRONT_FACE' indicator
12878 `GL_POLYGON_MODE' setting
12881 `GL_POLYGON_SMOOTH' flag
12884 `GL_POLYGON_STIPPLE' enable bit
12887 `GL_POLYGON_OFFSET_FILL' flag
12890 `GL_POLYGON_OFFSET_LINE' flag
12893 `GL_POLYGON_OFFSET_POINT' flag
12896 `GL_POLYGON_OFFSET_FACTOR'
12899 `GL_POLYGON_OFFSET_UNITS'
12901 `GL_POLYGON_STIPPLE_BIT'
12902 Polygon stipple image
12905 `GL_SCISSOR_TEST' flag
12910 `GL_STENCIL_BUFFER_BIT'
12911 `GL_STENCIL_TEST' enable bit
12914 Stencil function and reference value
12920 Stencil fail, pass, and depth buffer pass actions
12923 Stencil buffer clear value
12926 Stencil buffer writemask
12929 Enable bits for the four texture coordinates
12932 Border color for each texture image
12935 Minification function for each texture image
12938 Magnification function for each texture image
12941 Texture coordinates and wrap mode for each texture image
12944 Color and mode for each texture environment
12947 Enable bits `GL_TEXTURE_GEN_'X, X is S, T, R, and Q
12950 `GL_TEXTURE_GEN_MODE' setting for S, T, R, and Q
12953 `glTexGen' plane equations for S, T, R, and Q
12956 Current texture bindings (for example, `GL_TEXTURE_BINDING_2D')
12959 Coefficients of the six clipping planes
12962 Enable bits for the user-definable clipping planes
12965 `GL_MATRIX_MODE' value
12968 `GL_NORMALIZE' flag
12971 `GL_RESCALE_NORMAL' flag
12974 Depth range (near and far)
12977 Viewport origin and extent
12979 `glPopAttrib' restores the values of the state variables saved with the
12980 last `glPushAttrib' command. Those not saved are left unchanged.
12982 It is an error to push attributes onto a full stack or to pop attributes
12983 off an empty stack. In either case, the error flag is set and no other
12984 change is made to GL state.
12986 Initially, the attribute stack is empty.
12988 `GL_STACK_OVERFLOW' is generated if `glPushAttrib' is called while the
12989 attribute stack is full.
12991 `GL_STACK_UNDERFLOW' is generated if `glPopAttrib' is called while the
12992 attribute stack is empty.
12994 `GL_INVALID_OPERATION' is generated if `glPushAttrib' or `glPopAttrib'
12995 is executed between the execution of `glBegin' and the corresponding
12996 execution of `glEnd'.")
12998 (define-gl-procedures
12999 ((glPushClientAttrib (mask GLbitfield) -> void)
13000 (glPopClientAttrib -> void))
13001 "Push and pop the client attribute stack.
13004 Specifies a mask that indicates which attributes to save. Values
13005 for MASK are listed below.
13007 `glPushClientAttrib' takes one argument, a mask that indicates which
13008 groups of client-state variables to save on the client attribute stack.
13009 Symbolic constants are used to set bits in the mask. MASK is typically
13010 constructed by specifying the bitwise-or of several of these constants
13011 together. The special mask `GL_CLIENT_ALL_ATTRIB_BITS' can be used to
13012 save all stackable client state.
13014 The symbolic mask constants and their associated GL client state are as
13015 follows (the second column lists which attributes are saved):
13017 `GL_CLIENT_PIXEL_STORE_BIT' Pixel storage modes
13018 `GL_CLIENT_VERTEX_ARRAY_BIT' Vertex arrays (and enables)
13020 `glPopClientAttrib' restores the values of the client-state variables
13021 saved with the last `glPushClientAttrib'. Those not saved are left
13024 It is an error to push attributes onto a full client attribute stack or
13025 to pop attributes off an empty stack. In either case, the error flag is
13026 set, and no other change is made to GL state.
13028 Initially, the client attribute stack is empty.
13030 `GL_STACK_OVERFLOW' is generated if `glPushClientAttrib' is called while
13031 the attribute stack is full.
13033 `GL_STACK_UNDERFLOW' is generated if `glPopClientAttrib' is called while
13034 the attribute stack is empty.")
13036 (define-gl-procedures
13037 ((glPushMatrix -> void) (glPopMatrix -> void))
13038 "Push and pop the current matrix stack.
13040 There is a stack of matrices for each of the matrix modes. In
13041 `GL_MODELVIEW' mode, the stack depth is at least 32. In the other modes,
13042 `GL_COLOR', `GL_PROJECTION', and `GL_TEXTURE', the depth is at least 2.
13043 The current matrix in any mode is the matrix on the top of the stack for
13046 `glPushMatrix' pushes the current matrix stack down by one, duplicating
13047 the current matrix. That is, after a `glPushMatrix' call, the matrix on
13048 top of the stack is identical to the one below it.
13050 `glPopMatrix' pops the current matrix stack, replacing the current
13051 matrix with the one below it on the stack.
13053 Initially, each of the stacks contains one matrix, an identity matrix.
13055 It is an error to push a full matrix stack or to pop a matrix stack that
13056 contains only a single matrix. In either case, the error flag is set and
13057 no other change is made to GL state.
13059 `GL_STACK_OVERFLOW' is generated if `glPushMatrix' is called while the
13060 current matrix stack is full.
13062 `GL_STACK_UNDERFLOW' is generated if `glPopMatrix' is called while the
13063 current matrix stack contains only a single matrix.
13065 `GL_INVALID_OPERATION' is generated if `glPushMatrix' or `glPopMatrix'
13066 is executed between the execution of `glBegin' and the corresponding
13067 execution of `glEnd'.")
13069 (define-gl-procedures
13070 ((glPushName (name GLuint) -> void)
13071 (glPopName -> void))
13072 "Push and pop the name stack.
13075 Specifies a name that will be pushed onto the name stack.
13077 The name stack is used during selection mode to allow sets of rendering
13078 commands to be uniquely identified. It consists of an ordered set of
13079 unsigned integers and is initially empty.
13081 `glPushName' causes NAME to be pushed onto the name stack. `glPopName'
13082 pops one name off the top of the stack.
13084 The maximum name stack depth is implementation-dependent; call
13085 `GL_MAX_NAME_STACK_DEPTH' to find out the value for a particular
13086 implementation. It is an error to push a name onto a full stack or to
13087 pop a name off an empty stack. It is also an error to manipulate the
13088 name stack between the execution of `glBegin' and the corresponding
13089 execution of `glEnd'. In any of these cases, the error flag is set and
13090 no other change is made to GL state.
13092 The name stack is always empty while the render mode is not `GL_SELECT'.
13093 Calls to `glPushName' or `glPopName' while the render mode is not
13094 `GL_SELECT' are ignored.
13096 `GL_STACK_OVERFLOW' is generated if `glPushName' is called while the
13097 name stack is full.
13099 `GL_STACK_UNDERFLOW' is generated if `glPopName' is called while the
13100 name stack is empty.
13102 `GL_INVALID_OPERATION' is generated if `glPushName' or `glPopName' is
13103 executed between a call to `glBegin' and the corresponding call to
13106 (define-gl-procedures
13107 ((glRasterPos2i (x GLint) (y GLint) -> void)
13108 (glRasterPos2f (x GLfloat) (y GLfloat) -> void)
13135 "Specify the raster position for pixel operations.
13144 Specify the X , Y , Z , and W object coordinates (if present) for
13145 the raster position.
13147 The GL maintains a 3D position in window coordinates. This position,
13148 called the raster position, is used to position pixel and bitmap write
13149 operations. It is maintained with subpixel accuracy. See `glBitmap',
13150 `glDrawPixels', and `glCopyPixels'.
13152 The current raster position consists of three window coordinates (X , Y
13153 , Z ), a clip coordinate value (W ), an eye coordinate distance, a valid
13154 bit, and associated color data and texture coordinates. The W coordinate
13155 is a clip coordinate, because W is not projected to window coordinates.
13156 `glRasterPos4' specifies object coordinates X , Y , Z , and W
13157 explicitly. `glRasterPos3' specifies object coordinate X , Y , and Z
13158 explicitly, while W is implicitly set to 1. `glRasterPos2' uses the
13159 argument values for X and Y while implicitly setting Z and W to 0 and 1.
13161 The object coordinates presented by `glRasterPos' are treated just like
13162 those of a `glVertex' command: They are transformed by the current
13163 modelview and projection matrices and passed to the clipping stage. If
13164 the vertex is not culled, then it is projected and scaled to window
13165 coordinates, which become the new current raster position, and the
13166 `GL_CURRENT_RASTER_POSITION_VALID' flag is set. If the vertex IS culled,
13167 then the valid bit is cleared and the current raster position and
13168 associated color and texture coordinates are undefined.
13170 The current raster position also includes some associated color data and
13171 texture coordinates. If lighting is enabled, then
13172 `GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
13173 (in color index mode) is set to the color produced by the lighting
13174 calculation (see `glLight', `glLightModel', and `glShadeModel'). If
13175 lighting is disabled, current color (in RGBA mode, state variable
13176 `GL_CURRENT_COLOR') or color index (in color index mode, state variable
13177 `GL_CURRENT_INDEX') is used to update the current raster color.
13178 `GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
13180 Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
13181 `GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
13182 generation functions (see `glTexGen'). Finally, the distance from the
13183 origin of the eye coordinate system to the vertex as transformed by only
13184 the modelview matrix replaces `GL_CURRENT_RASTER_DISTANCE'.
13186 Initially, the current raster position is (0, 0, 0, 1), the current
13187 raster distance is 0, the valid bit is set, the associated RGBA color is
13188 (1, 1, 1, 1), the associated color index is 1, and the associated
13189 texture coordinates are (0, 0, 0, 1). In RGBA mode,
13190 `GL_CURRENT_RASTER_INDEX' is always 1; in color index mode, the current
13191 raster RGBA color always maintains its initial value.
13193 `GL_INVALID_OPERATION' is generated if `glRasterPos' is executed between
13194 the execution of `glBegin' and the corresponding execution of `glEnd'.")
13196 (define-gl-procedures
13197 ((glReadBuffer (mode GLenum) -> void))
13198 "Select a color buffer source for pixels.
13201 Specifies a color buffer. Accepted values are `GL_FRONT_LEFT',
13202 `GL_FRONT_RIGHT', `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT',
13203 `GL_BACK', `GL_LEFT', `GL_RIGHT', and `GL_AUX'I, where I is between
13204 0 and the value of `GL_AUX_BUFFERS' minus 1.
13206 `glReadBuffer' specifies a color buffer as the source for subsequent
13207 `glReadPixels', `glCopyTexImage1D', `glCopyTexImage2D',
13208 `glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D', and
13209 `glCopyPixels' commands. MODE accepts one of twelve or more predefined
13210 values. (`GL_AUX0' through `GL_AUX3' are always defined.) In a fully
13211 configured system, `GL_FRONT', `GL_LEFT', and `GL_FRONT_LEFT' all name
13212 the front left buffer, `GL_FRONT_RIGHT' and `GL_RIGHT' name the front
13213 right buffer, and `GL_BACK_LEFT' and `GL_BACK' name the back left
13216 Nonstereo double-buffered configurations have only a front left and a
13217 back left buffer. Single-buffered configurations have a front left and a
13218 front right buffer if stereo, and only a front left buffer if nonstereo.
13219 It is an error to specify a nonexistent buffer to `glReadBuffer'.
13221 MODE is initially `GL_FRONT' in single-buffered configurations and
13222 `GL_BACK' in double-buffered configurations.
13224 `GL_INVALID_ENUM' is generated if MODE is not one of the twelve (or
13225 more) accepted values.
13227 `GL_INVALID_OPERATION' is generated if MODE specifies a buffer that does
13230 `GL_INVALID_OPERATION' is generated if `glReadBuffer' is executed
13231 between the execution of `glBegin' and the corresponding execution of
13234 (define-gl-procedures
13245 "Read a block of pixels from the frame buffer.
13250 Specify the window coordinates of the first pixel that is read from
13251 the frame buffer. This location is the lower left corner of a
13252 rectangular block of pixels.
13257 Specify the dimensions of the pixel rectangle. WIDTH and HEIGHT of
13258 one correspond to a single pixel.
13261 Specifies the format of the pixel data. The following symbolic
13262 values are accepted: `GL_COLOR_INDEX', `GL_STENCIL_INDEX',
13263 `GL_DEPTH_COMPONENT', `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA',
13264 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
13265 `GL_LUMINANCE_ALPHA'.
13268 Specifies the data type of the pixel data. Must be one of
13269 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
13270 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
13271 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
13272 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
13273 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
13274 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
13275 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
13276 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV'.
13279 Returns the pixel data.
13281 `glReadPixels' returns pixel data from the frame buffer, starting with
13282 the pixel whose lower left corner is at location (X, Y), into client
13283 memory starting at location DATA. Several parameters control the
13284 processing of the pixel data before it is placed into client memory.
13285 These parameters are set with three commands: `glPixelStore',
13286 `glPixelTransfer', and `glPixelMap'. This reference page describes the
13287 effects on `glReadPixels' of most, but not all of the parameters
13288 specified by these three commands.
13290 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
13291 target (see `glBindBuffer') while a block of pixels is requested, DATA
13292 is treated as a byte offset into the buffer object's data store rather
13293 than a pointer to client memory.
13295 When the `ARB_imaging' extension is supported, the pixel data may be
13296 processed by additional operations including color table lookup, color
13297 matrix transformations, convolutions, histograms, and minimum and
13298 maximum pixel value computations.
13300 `glReadPixels' returns values from each pixel with lower left corner at
13301 (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said to be the
13302 I th pixel in the J th row. Pixels are returned in row order from the
13303 lowest to the highest row, left to right in each row.
13305 FORMAT specifies the format for the returned pixel values; accepted
13309 Color indices are read from the color buffer selected by
13310 `glReadBuffer'. Each index is converted to fixed point, shifted
13311 left or right depending on the value and sign of `GL_INDEX_SHIFT',
13312 and added to `GL_INDEX_OFFSET'. If `GL_MAP_COLOR' is `GL_TRUE',
13313 indices are replaced by their mappings in the table
13314 `GL_PIXEL_MAP_I_TO_I'.
13317 Stencil values are read from the stencil buffer. Each index is
13318 converted to fixed point, shifted left or right depending on the
13319 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'.
13320 If `GL_MAP_STENCIL' is `GL_TRUE', indices are replaced by their
13321 mappings in the table `GL_PIXEL_MAP_S_TO_S'.
13323 `GL_DEPTH_COMPONENT'
13324 Depth values are read from the depth buffer. Each component is
13325 converted to floating point such that the minimum depth value maps
13326 to 0 and the maximum value maps to 1. Each component is then
13327 multiplied by `GL_DEPTH_SCALE', added to `GL_DEPTH_BIAS', and
13328 finally clamped to the range [0,1] .
13339 `GL_LUMINANCE_ALPHA'
13340 Processing differs depending on whether color buffers store color
13341 indices or RGBA color components. If color indices are stored, they
13342 are read from the color buffer selected by `glReadBuffer'. Each
13343 index is converted to fixed point, shifted left or right depending
13344 on the value and sign of `GL_INDEX_SHIFT', and added to
13345 `GL_INDEX_OFFSET'. Indices are then replaced by the red, green,
13346 blue, and alpha values obtained by indexing the tables
13347 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
13348 `GL_PIXEL_MAP_I_TO_B', and `GL_PIXEL_MAP_I_TO_A'. Each table must
13349 be of size 2^N , but N may be different for different tables.
13350 Before an index is used to look up a value in a table of size 2^N ,
13351 it must be masked against 2^N-1 .
13353 If RGBA color components are stored in the color buffers, they are
13354 read from the color buffer selected by `glReadBuffer'. Each color
13355 component is converted to floating point such that zero intensity
13356 maps to 0.0 and full intensity maps to 1.0. Each component is then
13357 multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where C is
13358 RED, GREEN, BLUE, or ALPHA. Finally, if `GL_MAP_COLOR' is
13359 `GL_TRUE', each component is clamped to the range [0,1] , scaled to
13360 the size of its corresponding table, and is then replaced by its
13361 mapping in the table `GL_PIXEL_MAP_c_TO_c', where C is R, G, B, or
13364 Unneeded data is then discarded. For example, `GL_RED' discards the
13365 green, blue, and alpha components, while `GL_RGB' discards only the
13366 alpha component. `GL_LUMINANCE' computes a single-component value
13367 as the sum of the red, green, and blue components, and
13368 `GL_LUMINANCE_ALPHA' does the same, while keeping alpha as a second
13369 value. The final values are clamped to the range [0,1] .
13371 The shift, scale, bias, and lookup factors just described are all
13372 specified by `glPixelTransfer'. The lookup table contents themselves are
13373 specified by `glPixelMap'.
13375 Finally, the indices or components are converted to the proper format,
13376 as specified by TYPE. If FORMAT is `GL_COLOR_INDEX' or
13377 `GL_STENCIL_INDEX' and TYPE is not `GL_FLOAT', each index is masked with
13378 the mask value given in the following table. If TYPE is `GL_FLOAT', then
13379 each integer index is converted to single-precision floating-point
13382 If FORMAT is `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
13383 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'
13384 and TYPE is not `GL_FLOAT', each component is multiplied by the
13385 multiplier shown in the following table. If type is `GL_FLOAT', then
13386 each component is passed as is (or converted to the client's
13387 single-precision floating-point format if it is different from the one
13393 *Index Mask*, *Component Conversion*
13396 2^8-1 , (2^8-1,)\u2062C
13399 2^7-1 , (2^8-1,)\u2062C-1,/2
13404 `GL_UNSIGNED_SHORT'
13405 2^16-1 , (2^16-1,)\u2062C
13408 2^15-1 , (2^16-1,)\u2062C-1,/2
13411 2^32-1 , (2^32-1,)\u2062C
13414 2^31-1 , (2^32-1,)\u2062C-1,/2
13419 Return values are placed in memory as follows. If FORMAT is
13420 `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT', `GL_RED',
13421 `GL_GREEN', `GL_BLUE', `GL_ALPHA', or `GL_LUMINANCE', a single value is
13422 returned and the data for the I th pixel in the J th row is placed in
13423 location (J,)\u2062WIDTH+I . `GL_RGB' and `GL_BGR' return three values,
13424 `GL_RGBA' and `GL_BGRA' return four values, and `GL_LUMINANCE_ALPHA'
13425 returns two values for each pixel, with all values corresponding to a
13426 single pixel occupying contiguous space in DATA. Storage parameters set
13427 by `glPixelStore', such as `GL_PACK_LSB_FIRST' and `GL_PACK_SWAP_BYTES',
13428 affect the way that data is written into memory. See `glPixelStore' for
13431 `GL_INVALID_ENUM' is generated if FORMAT or TYPE is not an accepted
13434 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
13435 `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
13437 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
13439 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_COLOR_INDEX' and
13440 the color buffers store RGBA color components.
13442 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
13443 there is no stencil buffer.
13445 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
13446 and there is no depth buffer.
13448 `GL_INVALID_OPERATION' is generated if TYPE is one of
13449 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
13450 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
13453 `GL_INVALID_OPERATION' is generated if TYPE is one of
13454 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
13455 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
13456 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
13457 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
13458 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
13460 The formats `GL_BGR', and `GL_BGRA' and types `GL_UNSIGNED_BYTE_3_3_2',
13461 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
13462 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
13463 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
13464 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
13465 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
13466 `GL_UNSIGNED_INT_2_10_10_10_REV' are available only if the GL version is
13469 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13470 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
13471 store is currently mapped.
13473 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13474 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
13475 to the buffer object such that the memory writes required would exceed
13476 the data store size.
13478 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13479 bound to the `GL_PIXEL_PACK_BUFFER' target and DATA is not evenly
13480 divisible into the number of bytes needed to store in memory a datum
13483 `GL_INVALID_OPERATION' is generated if `glReadPixels' is executed
13484 between the execution of `glBegin' and the corresponding execution of
13487 (define-gl-procedures
13507 Specify one vertex of a rectangle.
13512 Specify the opposite vertex of the rectangle.
13514 `glRect' supports efficient specification of rectangles as two corner
13515 points. Each rectangle command takes four arguments, organized either as
13516 two consecutive pairs of (X,Y) coordinates or as two pointers to arrays,
13517 each containing an (X,Y) pair. The resulting rectangle is defined in the
13520 `glRect'(X1, Y1, X2, Y2) is exactly equivalent to the following
13521 sequence: Note that if the second vertex is above and to the right of
13522 the first vertex, the rectangle is constructed with a counterclockwise
13526 glBegin(`GL_POLYGON');
13533 `GL_INVALID_OPERATION' is generated if `glRect' is executed between the
13534 execution of `glBegin' and the corresponding execution of `glEnd'.")
13536 (define-gl-procedures
13537 ((glRenderMode (mode GLenum) -> GLint))
13538 "Set rasterization mode.
13541 Specifies the rasterization mode. Three values are accepted:
13542 `GL_RENDER', `GL_SELECT', and `GL_FEEDBACK'. The initial value is
13545 `glRenderMode' sets the rasterization mode. It takes one argument, MODE,
13546 which can assume one of three predefined values:
13549 Render mode. Primitives are rasterized, producing pixel fragments,
13550 which are written into the frame buffer. This is the normal mode
13551 and also the default mode.
13554 Selection mode. No pixel fragments are produced, and no change to
13555 the frame buffer contents is made. Instead, a record of the names
13556 of primitives that would have been drawn if the render mode had
13557 been `GL_RENDER' is returned in a select buffer, which must be
13558 created (see `glSelectBuffer') before selection mode is entered.
13561 Feedback mode. No pixel fragments are produced, and no change to
13562 the frame buffer contents is made. Instead, the coordinates and
13563 attributes of vertices that would have been drawn if the render
13564 mode had been `GL_RENDER' is returned in a feedback buffer, which
13565 must be created (see `glFeedbackBuffer') before feedback mode is
13568 The return value of `glRenderMode' is determined by the render mode at
13569 the time `glRenderMode' is called, rather than by MODE. The values
13570 returned for the three render modes are as follows:
13576 The number of hit records transferred to the select buffer.
13579 The number of values (not vertices) transferred to the feedback
13582 See the `glSelectBuffer' and `glFeedbackBuffer' reference pages for more
13583 details concerning selection and feedback operation.
13585 `GL_INVALID_ENUM' is generated if MODE is not one of the three accepted
13588 `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
13589 the render mode is `GL_SELECT', or if `glRenderMode' is called with
13590 argument `GL_SELECT' before `glSelectBuffer' is called at least once.
13592 `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
13593 while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
13594 with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
13597 `GL_INVALID_OPERATION' is generated if `glRenderMode' is executed
13598 between the execution of `glBegin' and the corresponding execution of
13601 (define-gl-procedures
13602 ((glResetHistogram (target GLenum) -> void))
13603 "Reset histogram table entries to zero.
13606 Must be `GL_HISTOGRAM'.
13608 `glResetHistogram' resets all the elements of the current histogram
13611 `GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
13613 `GL_INVALID_OPERATION' is generated if `glResetHistogram' is executed
13614 between the execution of `glBegin' and the corresponding execution of
13617 (define-gl-procedures
13618 ((glResetMinmax (target GLenum) -> void))
13619 "Reset minmax table entries to initial values.
13622 Must be `GL_MINMAX'.
13624 `glResetMinmax' resets the elements of the current minmax table to their
13625 initial values: the ``maximum'' element receives the minimum possible
13626 component values, and the ``minimum'' element receives the maximum
13627 possible component values.
13629 `GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
13631 `GL_INVALID_OPERATION' is generated if `glResetMinmax' is executed
13632 between the execution of `glBegin' and the corresponding execution of
13635 (define-gl-procedures
13643 "Multiply the current matrix by a rotation matrix.
13646 Specifies the angle of rotation, in degrees.
13653 Specify the X, Y, and Z coordinates of a vector, respectively.
13655 `glRotate' produces a rotation of ANGLE degrees around the vector (X,YZ)
13656 . The current matrix (see `glMatrixMode') is multiplied by a rotation
13657 matrix with the product replacing the current matrix, as if
13658 `glMultMatrix' were called with the following matrix as its argument:
13660 ((X^2\u2061(1-C,)+C X\u2062Y\u2061(1-C,)-Z\u2062S X\u2062Z\u2061(1-C,)+Y\u2062S 0), (Y\u2062X\u2061(1-C,)+Z\u2062S
13661 Y^2\u2061(1-C,)+C Y\u2062Z\u2061(1-C,)-X\u2062S 0), (X\u2062Z\u2061(1-C,)-Y\u2062S Y\u2062Z\u2061(1-C,)+X\u2062S
13662 Z^2\u2061(1-C,)+C 0), (0 0 0 1),)
13666 Where C=COS\u2061(ANGLE,) , S=SIN\u2061(ANGLE,) , and ∥(X,YZ),∥=1 (if not, the GL
13667 will normalize this vector).
13673 If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
13674 objects drawn after `glRotate' is called are rotated. Use `glPushMatrix'
13675 and `glPopMatrix' to save and restore the unrotated coordinate system.
13677 `GL_INVALID_OPERATION' is generated if `glRotate' is executed between
13678 the execution of `glBegin' and the corresponding execution of `glEnd'.")
13680 (define-gl-procedures
13686 "Specify multisample coverage parameters.
13689 Specify a single floating-point sample coverage value. The value is
13690 clamped to the range [0,1] . The initial value is 1.0.
13693 Specify a single boolean value representing if the coverage masks
13694 should be inverted. `GL_TRUE' and `GL_FALSE' are accepted. The
13695 initial value is `GL_FALSE'.
13697 Multisampling samples a pixel multiple times at various
13698 implementation-dependent subpixel locations to generate antialiasing
13699 effects. Multisampling transparently antialiases points, lines,
13700 polygons, bitmaps, and images if it is enabled.
13702 VALUE is used in constructing a temporary mask used in determining which
13703 samples will be used in resolving the final fragment color. This mask is
13704 bitwise-anded with the coverage mask generated from the multisampling
13705 computation. If the INVERT flag is set, the temporary mask is inverted
13706 (all bits flipped) and then the bitwise-and is computed.
13708 If an implementation does not have any multisample buffers available, or
13709 multisampling is disabled, rasterization occurs with only a single
13710 sample computing a pixel's final RGB color.
13712 Provided an implementation supports multisample buffers, and
13713 multisampling is enabled, then a pixel's final color is generated by
13714 combining several samples per pixel. Each sample contains color, depth,
13715 and stencil information, allowing those operations to be performed on
13718 `GL_INVALID_OPERATION' is generated if `glSampleCoverage' is executed
13719 between the execution of `glBegin' and the corresponding execution of
13722 (define-gl-procedures
13729 "Multiply the current matrix by a general scaling matrix.
13736 Specify scale factors along the X, Y, and Z axes, respectively.
13738 `glScale' produces a nonuniform scaling along the X, Y, and Z axes. The
13739 three parameters indicate the desired scale factor along each of the
13742 The current matrix (see `glMatrixMode') is multiplied by this scale
13743 matrix, and the product replaces the current matrix as if `glMultMatrix'
13744 were called with the following matrix as its argument:
13746 ((X 0 0 0), (0 Y 0 0), (0 0 Z 0), (0 0 0 1),)
13748 If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
13749 objects drawn after `glScale' is called are scaled.
13751 Use `glPushMatrix' and `glPopMatrix' to save and restore the unscaled
13754 `GL_INVALID_OPERATION' is generated if `glScale' is executed between the
13755 execution of `glBegin' and the corresponding execution of `glEnd'.")
13757 (define-gl-procedures
13765 "Define the scissor box.
13770 Specify the lower left corner of the scissor box. Initially (0, 0).
13775 Specify the width and height of the scissor box. When a GL context
13776 is first attached to a window, WIDTH and HEIGHT are set to the
13777 dimensions of that window.
13779 `glScissor' defines a rectangle, called the scissor box, in window
13780 coordinates. The first two arguments, X and Y, specify the lower left
13781 corner of the box. WIDTH and HEIGHT specify the width and height of the
13784 To enable and disable the scissor test, call `glEnable' and `glDisable'
13785 with argument `GL_SCISSOR_TEST'. The test is initially disabled. While
13786 the test is enabled, only pixels that lie within the scissor box can be
13787 modified by drawing commands. Window coordinates have integer values at
13788 the shared corners of frame buffer pixels. `glScissor(0,0,1,1)' allows
13789 modification of only the lower left pixel in the window, and
13790 `glScissor(0,0,0,0)' doesn't allow modification of any pixels in the
13793 When the scissor test is disabled, it is as though the scissor box
13794 includes the entire window.
13796 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
13798 `GL_INVALID_OPERATION' is generated if `glScissor' is executed between
13799 the execution of `glBegin' and the corresponding execution of `glEnd'.")
13801 (define-gl-procedures
13802 ((glSecondaryColorPointer
13806 (pointer const-GLvoid-*)
13809 "Define an array of secondary colors.
13812 Specifies the number of components per color. Must be 3.
13815 Specifies the data type of each color component in the array.
13816 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
13817 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
13818 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
13821 Specifies the byte offset between consecutive colors. If STRIDE is
13822 0, the colors are understood to be tightly packed in the array. The
13823 initial value is 0.
13826 Specifies a pointer to the first component of the first color
13827 element in the array. The initial value is 0.
13829 `glSecondaryColorPointer' specifies the location and data format of an
13830 array of color components to use when rendering. SIZE specifies the
13831 number of components per color, and must be 3. TYPE specifies the data
13832 type of each color component, and STRIDE specifies the byte stride from
13833 one color to the next, allowing vertices and attributes to be packed
13834 into a single array or stored in separate arrays.
13836 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
13837 target (see `glBindBuffer') while a secondary color array is specified,
13838 POINTER is treated as a byte offset into the buffer object's data store.
13839 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
13840 secondary color vertex array client-side state
13841 (`GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING').
13843 When a secondary color array is specified, SIZE, TYPE, STRIDE, and
13844 POINTER are saved as client-side state, in addition to the current
13845 vertex array buffer object binding.
13847 To enable and disable the secondary color array, call
13848 `glEnableClientState' and `glDisableClientState' with the argument
13849 `GL_SECONDARY_COLOR_ARRAY'. If enabled, the secondary color array is
13850 used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
13851 `glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
13854 `GL_INVALID_VALUE' is generated if SIZE is not 3.
13856 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
13858 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
13860 (define-gl-procedures
13861 ((glSecondaryColor3i
13867 (glSecondaryColor3f
13873 (glSecondaryColor3ui
13879 "Set the current secondary color.
13886 Specify new red, green, and blue values for the current secondary
13889 The GL stores both a primary four-valued RGBA color and a secondary
13890 four-valued RGBA color (where alpha is always set to 0.0) that is
13891 associated with every vertex.
13893 The secondary color is interpolated and applied to each fragment during
13894 rasterization when `GL_COLOR_SUM' is enabled. When lighting is enabled,
13895 and `GL_SEPARATE_SPECULAR_COLOR' is specified, the value of the
13896 secondary color is assigned the value computed from the specular term of
13897 the lighting computation. Both the primary and secondary current colors
13898 are applied to each fragment, regardless of the state of `GL_COLOR_SUM',
13899 under such conditions. When `GL_SEPARATE_SPECULAR_COLOR' is specified,
13900 the value returned from querying the current secondary color is
13903 `glSecondaryColor3b', `glSecondaryColor3s', and `glSecondaryColor3i'
13904 take three signed byte, short, or long integers as arguments. When *v*
13905 is appended to the name, the color commands can take a pointer to an
13906 array of such values.
13908 Color values are stored in floating-point format, with unspecified
13909 mantissa and exponent sizes. Unsigned integer color components, when
13910 specified, are linearly mapped to floating-point values such that the
13911 largest representable value maps to 1.0 (full intensity), and 0 maps to
13912 0.0 (zero intensity). Signed integer color components, when specified,
13913 are linearly mapped to floating-point values such that the most positive
13914 representable value maps to 1.0, and the most negative representable
13915 value maps to -1.0 . (Note that this mapping does not convert 0
13916 precisely to 0.0). Floating-point values are mapped directly.
13918 Neither floating-point nor signed integer values are clamped to the
13919 range [0,1] before the current color is updated. However, color
13920 components are clamped to this range before they are interpolated or
13921 written into a color buffer.")
13923 (define-gl-procedures
13929 "Establish a buffer for selection mode values.
13932 Specifies the size of BUFFER.
13935 Returns the selection data.
13937 `glSelectBuffer' has two arguments: BUFFER is a pointer to an array of
13938 unsigned integers, and SIZE indicates the size of the array. BUFFER
13939 returns values from the name stack (see `glInitNames', `glLoadName',
13940 `glPushName') when the rendering mode is `GL_SELECT' (see
13941 `glRenderMode'). `glSelectBuffer' must be issued before selection mode
13942 is enabled, and it must not be issued while the rendering mode is
13945 A programmer can use selection to determine which primitives are drawn
13946 into some region of a window. The region is defined by the current
13947 modelview and perspective matrices.
13949 In selection mode, no pixel fragments are produced from rasterization.
13950 Instead, if a primitive or a raster position intersects the clipping
13951 volume defined by the viewing frustum and the user-defined clipping
13952 planes, this primitive causes a selection hit. (With polygons, no hit
13953 occurs if the polygon is culled.) When a change is made to the name
13954 stack, or when `glRenderMode' is called, a hit record is copied to
13955 BUFFER if any hits have occurred since the last such event (name stack
13956 change or `glRenderMode' call). The hit record consists of the number of
13957 names in the name stack at the time of the event, followed by the
13958 minimum and maximum depth values of all vertices that hit since the
13959 previous event, followed by the name stack contents, bottom name first.
13961 Depth values (which are in the range [0,1]) are multiplied by 2^32-1 ,
13962 before being placed in the hit record.
13964 An internal index into BUFFER is reset to 0 whenever selection mode is
13965 entered. Each time a hit record is copied into BUFFER, the index is
13966 incremented to point to the cell just past the end of the block of
13967 names\\(emthat is, to the next available cell If the hit record is larger
13968 than the number of remaining locations in BUFFER, as much data as can
13969 fit is copied, and the overflow flag is set. If the name stack is empty
13970 when a hit record is copied, that record consists of 0 followed by the
13971 minimum and maximum depth values.
13973 To exit selection mode, call `glRenderMode' with an argument other than
13974 `GL_SELECT'. Whenever `glRenderMode' is called while the render mode is
13975 `GL_SELECT', it returns the number of hit records copied to BUFFER,
13976 resets the overflow flag and the selection buffer pointer, and
13977 initializes the name stack to be empty. If the overflow bit was set when
13978 `glRenderMode' was called, a negative hit record count is returned.
13980 `GL_INVALID_VALUE' is generated if SIZE is negative.
13982 `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
13983 the render mode is `GL_SELECT', or if `glRenderMode' is called with
13984 argument `GL_SELECT' before `glSelectBuffer' is called at least once.
13986 `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is executed
13987 between the execution of `glBegin' and the corresponding execution of
13990 (define-gl-procedures
13991 ((glSeparableFilter2D
13993 (internalformat GLenum)
13998 (row const-GLvoid-*)
13999 (column const-GLvoid-*)
14002 "Define a separable two-dimensional convolution filter.
14005 Must be `GL_SEPARABLE_2D'.
14008 The internal format of the convolution filter kernel. The allowable
14009 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
14010 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
14011 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
14012 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
14013 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
14014 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
14015 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
14016 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
14017 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
14018 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
14019 `GL_RGBA12', or `GL_RGBA16'.
14022 The number of elements in the pixel array referenced by ROW. (This
14023 is the width of the separable filter kernel.)
14026 The number of elements in the pixel array referenced by COLUMN.
14027 (This is the height of the separable filter kernel.)
14030 The format of the pixel data in ROW and COLUMN. The allowable
14031 values are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
14032 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_INTENSITY', `GL_LUMINANCE', and
14033 `GL_LUMINANCE_ALPHA'.
14036 The type of the pixel data in ROW and COLUMN. Symbolic constants
14037 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
14038 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
14039 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
14040 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
14041 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
14042 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
14043 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
14044 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
14048 Pointer to a one-dimensional array of pixel data that is processed
14049 to build the row filter kernel.
14052 Pointer to a one-dimensional array of pixel data that is processed
14053 to build the column filter kernel.
14055 `glSeparableFilter2D' builds a two-dimensional separable convolution
14056 filter kernel from two arrays of pixels.
14058 The pixel arrays specified by (WIDTH, FORMAT, TYPE, ROW) and (HEIGHT,
14059 FORMAT, TYPE, COLUMN) are processed just as if they had been passed to
14060 `glDrawPixels', but processing stops after the final expansion to RGBA
14063 If a non-zero named buffer object is bound to the
14064 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
14065 filter is specified, ROW and COLUMN are treated as byte offsets into the
14066 buffer object's data store.
14068 Next, the R, G, B, and A components of all pixels in both arrays are
14069 scaled by the four separable 2D `GL_CONVOLUTION_FILTER_SCALE' parameters
14070 and biased by the four separable 2D `GL_CONVOLUTION_FILTER_BIAS'
14071 parameters. (The scale and bias parameters are set by
14072 `glConvolutionParameter' using the `GL_SEPARABLE_2D' target and the
14073 names `GL_CONVOLUTION_FILTER_SCALE' and `GL_CONVOLUTION_FILTER_BIAS'.
14074 The parameters themselves are vectors of four values that are applied to
14075 red, green, blue, and alpha, in that order.) The R, G, B, and A values
14076 are not clamped to [0,1] at any time during this process.
14078 Each pixel is then converted to the internal format specified by
14079 INTERNALFORMAT. This conversion simply maps the component values of the
14080 pixel (R, G, B, and A) to the values included in the internal format
14081 (red, green, blue, alpha, luminance, and intensity). The mapping is as
14085 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
14090 `GL_LUMINANCE_ALPHA'
14102 The red, green, blue, alpha, luminance, and/or intensity components of
14103 the resulting pixels are stored in floating-point rather than integer
14104 format. They form two one-dimensional filter kernel images. The row
14105 image is indexed by coordinate I starting at zero and increasing from
14106 left to right. Each location in the row image is derived from element I
14107 of ROW. The column image is indexed by coordinate J starting at zero and
14108 increasing from bottom to top. Each location in the column image is
14109 derived from element J of COLUMN.
14111 Note that after a convolution is performed, the resulting color
14112 components are also scaled by their corresponding
14113 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
14114 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
14115 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
14116 set by `glPixelTransfer'.
14118 `GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
14120 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
14123 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
14126 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
14129 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
14130 than the maximum supported value. This value may be queried with
14131 `glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
14132 `GL_MAX_CONVOLUTION_WIDTH'.
14134 `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
14135 than the maximum supported value. This value may be queried with
14136 `glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
14137 `GL_MAX_CONVOLUTION_HEIGHT'.
14139 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
14140 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
14141 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
14144 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
14145 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
14146 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
14147 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
14148 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
14149 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
14151 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14152 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
14153 data store is currently mapped.
14155 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14156 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
14157 unpacked from the buffer object such that the memory reads required
14158 would exceed the data store size.
14160 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14161 bound to the `GL_PIXEL_UNPACK_BUFFER' target and ROW or COLUMN is not
14162 evenly divisible into the number of bytes needed to store in memory a
14163 datum indicated by TYPE.
14165 `GL_INVALID_OPERATION' is generated if `glSeparableFilter2D' is executed
14166 between the execution of `glBegin' and the corresponding execution of
14169 (define-gl-procedures
14170 ((glShadeModel (mode GLenum) -> void))
14171 "Select flat or smooth shading.
14174 Specifies a symbolic value representing a shading technique.
14175 Accepted values are `GL_FLAT' and `GL_SMOOTH'. The initial value is
14178 GL primitives can have either flat or smooth shading. Smooth shading,
14179 the default, causes the computed colors of vertices to be interpolated
14180 as the primitive is rasterized, typically assigning different colors to
14181 each resulting pixel fragment. Flat shading selects the computed color
14182 of just one vertex and assigns it to all the pixel fragments generated
14183 by rasterizing a single primitive. In either case, the computed color of
14184 a vertex is the result of lighting if lighting is enabled, or it is the
14185 current color at the time the vertex was specified if lighting is
14188 Flat and smooth shading are indistinguishable for points. Starting when
14189 `glBegin' is issued and counting vertices and primitives from 1, the GL
14190 gives each flat-shaded line segment I the computed color of vertex I+1 ,
14191 its second vertex. Counting similarly from 1, the GL gives each
14192 flat-shaded polygon the computed color of the vertex listed in the
14193 following table. This is the last vertex to specify the polygon in all
14194 cases except single polygons, where the first vertex specifies the
14199 * Primitive Type of Polygon I *
14202 Single polygon (I==1 )
14211 Independent triangle
14220 Flat and smooth shading are specified by `glShadeModel' with MODE set to
14221 `GL_FLAT' and `GL_SMOOTH', respectively.
14223 `GL_INVALID_ENUM' is generated if MODE is any value other than `GL_FLAT'
14226 `GL_INVALID_OPERATION' is generated if `glShadeModel' is executed
14227 between the execution of `glBegin' and the corresponding execution of
14230 (define-gl-procedures
14234 (string const-GLchar-**)
14235 (length const-GLint-*)
14238 "Replaces the source code in a shader object.
14241 Specifies the handle of the shader object whose source code is to
14245 Specifies the number of elements in the STRING and LENGTH arrays.
14248 Specifies an array of pointers to strings containing the source
14249 code to be loaded into the shader.
14252 Specifies an array of string lengths.
14254 `glShaderSource' sets the source code in SHADER to the source code in
14255 the array of strings specified by STRING. Any source code previously
14256 stored in the shader object is completely replaced. The number of
14257 strings in the array is specified by COUNT. If LENGTH is `NULL', each
14258 string is assumed to be null terminated. If LENGTH is a value other than
14259 `NULL', it points to an array containing a string length for each of the
14260 corresponding elements of STRING. Each element in the LENGTH array may
14261 contain the length of the corresponding string (the null character is
14262 not counted as part of the string length) or a value less than 0 to
14263 indicate that the string is null terminated. The source code strings are
14264 not scanned or parsed at this time; they are simply copied into the
14265 specified shader object.
14267 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
14270 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
14272 `GL_INVALID_VALUE' is generated if COUNT is less than 0.
14274 `GL_INVALID_OPERATION' is generated if `glShaderSource' is executed
14275 between the execution of `glBegin' and the corresponding execution of
14278 (define-gl-procedures
14279 ((glStencilFuncSeparate
14286 "Set front and/or back function and reference value for stencil testing.
14289 Specifies whether front and/or back stencil state is updated. Three
14290 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
14291 `GL_FRONT_AND_BACK'.
14294 Specifies the test function. Eight symbolic constants are valid:
14295 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
14296 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
14300 Specifies the reference value for the stencil test. REF is clamped
14301 to the range [0,2^N-1] , where N is the number of bitplanes in the
14302 stencil buffer. The initial value is 0.
14305 Specifies a mask that is ANDed with both the reference value and
14306 the stored stencil value when the test is done. The initial value
14309 Stenciling, like depth-buffering, enables and disables drawing on a
14310 per-pixel basis. You draw into the stencil planes using GL drawing
14311 primitives, then render geometry and images, using the stencil planes to
14312 mask out portions of the screen. Stenciling is typically used in
14313 multipass rendering algorithms to achieve special effects, such as
14314 decals, outlining, and constructive solid geometry rendering.
14316 The stencil test conditionally eliminates a pixel based on the outcome
14317 of a comparison between the reference value and the value in the stencil
14318 buffer. To enable and disable the test, call `glEnable' and `glDisable'
14319 with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
14320 of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
14322 There can be two separate sets of FUNC, REF, and MASK parameters; one
14323 affects back-facing polygons, and the other affects front-facing
14324 polygons as well as other non-polygon primitives. `glStencilFunc' sets
14325 both front and back stencil state to the same values, as if
14326 `glStencilFuncSeparate' were called with FACE set to
14327 `GL_FRONT_AND_BACK'.
14329 FUNC is a symbolic constant that determines the stencil comparison
14330 function. It accepts one of eight values, shown in the following list.
14331 REF is an integer reference value that is used in the stencil
14332 comparison. It is clamped to the range [0,2^N-1] , where N is the number
14333 of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
14334 reference value and the stored stencil value, with the ANDed values
14335 participating in the comparison.
14337 If STENCIL represents the value stored in the corresponding stencil
14338 buffer location, the following list shows the effect of each comparison
14339 function that can be specified by FUNC. Only if the comparison succeeds
14340 is the pixel passed through to the next stage in the rasterization
14341 process (see `glStencilOp'). All tests treat STENCIL values as unsigned
14342 integers in the range [0,2^N-1] , where N is the number of bitplanes in
14343 the stencil buffer.
14345 The following values are accepted by FUNC:
14351 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
14354 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
14357 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
14360 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
14363 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
14366 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
14371 `GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
14374 `GL_INVALID_OPERATION' is generated if `glStencilFuncSeparate' is
14375 executed between the execution of `glBegin' and the corresponding
14376 execution of `glEnd'.")
14378 (define-gl-procedures
14385 "Set front and back function and reference value for stencil testing.
14388 Specifies the test function. Eight symbolic constants are valid:
14389 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
14390 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
14394 Specifies the reference value for the stencil test. REF is clamped
14395 to the range [0,2^N-1] , where N is the number of bitplanes in the
14396 stencil buffer. The initial value is 0.
14399 Specifies a mask that is ANDed with both the reference value and
14400 the stored stencil value when the test is done. The initial value
14403 Stenciling, like depth-buffering, enables and disables drawing on a
14404 per-pixel basis. Stencil planes are first drawn into using GL drawing
14405 primitives, then geometry and images are rendered using the stencil
14406 planes to mask out portions of the screen. Stenciling is typically used
14407 in multipass rendering algorithms to achieve special effects, such as
14408 decals, outlining, and constructive solid geometry rendering.
14410 The stencil test conditionally eliminates a pixel based on the outcome
14411 of a comparison between the reference value and the value in the stencil
14412 buffer. To enable and disable the test, call `glEnable' and `glDisable'
14413 with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
14414 of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
14416 There can be two separate sets of FUNC, REF, and MASK parameters; one
14417 affects back-facing polygons, and the other affects front-facing
14418 polygons as well as other non-polygon primitives. `glStencilFunc' sets
14419 both front and back stencil state to the same values. Use
14420 `glStencilFuncSeparate' to set front and back stencil state to different
14423 FUNC is a symbolic constant that determines the stencil comparison
14424 function. It accepts one of eight values, shown in the following list.
14425 REF is an integer reference value that is used in the stencil
14426 comparison. It is clamped to the range [0,2^N-1] , where N is the number
14427 of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
14428 reference value and the stored stencil value, with the ANDed values
14429 participating in the comparison.
14431 If STENCIL represents the value stored in the corresponding stencil
14432 buffer location, the following list shows the effect of each comparison
14433 function that can be specified by FUNC. Only if the comparison succeeds
14434 is the pixel passed through to the next stage in the rasterization
14435 process (see `glStencilOp'). All tests treat STENCIL values as unsigned
14436 integers in the range [0,2^N-1] , where N is the number of bitplanes in
14437 the stencil buffer.
14439 The following values are accepted by FUNC:
14445 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
14448 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
14451 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
14454 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
14457 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
14460 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
14465 `GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
14468 `GL_INVALID_OPERATION' is generated if `glStencilFunc' is executed
14469 between the execution of `glBegin' and the corresponding execution of
14472 (define-gl-procedures
14473 ((glStencilMaskSeparate
14478 "Control the front and/or back writing of individual bits in the stencil
14482 Specifies whether the front and/or back stencil writemask is
14483 updated. Three symbolic constants are valid: `GL_FRONT', `GL_BACK',
14484 and `GL_FRONT_AND_BACK'.
14487 Specifies a bit mask to enable and disable writing of individual
14488 bits in the stencil planes. Initially, the mask is all 1's.
14490 `glStencilMaskSeparate' controls the writing of individual bits in the
14491 stencil planes. The least significant N bits of MASK, where N is the
14492 number of bits in the stencil buffer, specify a mask. Where a 1 appears
14493 in the mask, it's possible to write to the corresponding bit in the
14494 stencil buffer. Where a 0 appears, the corresponding bit is
14495 write-protected. Initially, all bits are enabled for writing.
14497 There can be two separate MASK writemasks; one affects back-facing
14498 polygons, and the other affects front-facing polygons as well as other
14499 non-polygon primitives. `glStencilMask' sets both front and back stencil
14500 writemasks to the same values, as if `glStencilMaskSeparate' were called
14501 with FACE set to `GL_FRONT_AND_BACK'.
14503 `GL_INVALID_OPERATION' is generated if `glStencilMaskSeparate' is
14504 executed between the execution of `glBegin' and the corresponding
14505 execution of `glEnd'.")
14507 (define-gl-procedures
14508 ((glStencilMask (mask GLuint) -> void))
14509 "Control the front and back writing of individual bits in the stencil
14513 Specifies a bit mask to enable and disable writing of individual
14514 bits in the stencil planes. Initially, the mask is all 1's.
14516 `glStencilMask' controls the writing of individual bits in the stencil
14517 planes. The least significant N bits of MASK, where N is the number of
14518 bits in the stencil buffer, specify a mask. Where a 1 appears in the
14519 mask, it's possible to write to the corresponding bit in the stencil
14520 buffer. Where a 0 appears, the corresponding bit is write-protected.
14521 Initially, all bits are enabled for writing.
14523 There can be two separate MASK writemasks; one affects back-facing
14524 polygons, and the other affects front-facing polygons as well as other
14525 non-polygon primitives. `glStencilMask' sets both front and back stencil
14526 writemasks to the same values. Use `glStencilMaskSeparate' to set front
14527 and back stencil writemasks to different values.
14529 `GL_INVALID_OPERATION' is generated if `glStencilMask' is executed
14530 between the execution of `glBegin' and the corresponding execution of
14533 (define-gl-procedures
14534 ((glStencilOpSeparate
14541 "Set front and/or back stencil test actions.
14544 Specifies whether front and/or back stencil state is updated. Three
14545 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
14546 `GL_FRONT_AND_BACK'.
14549 Specifies the action to take when the stencil test fails. Eight
14550 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
14551 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
14552 and `GL_INVERT'. The initial value is `GL_KEEP'.
14555 Specifies the stencil action when the stencil test passes, but the
14556 depth test fails. DPFAIL accepts the same symbolic constants as
14557 SFAIL. The initial value is `GL_KEEP'.
14560 Specifies the stencil action when both the stencil test and the
14561 depth test pass, or when the stencil test passes and either there
14562 is no depth buffer or depth testing is not enabled. DPPASS accepts
14563 the same symbolic constants as SFAIL. The initial value is
14566 Stenciling, like depth-buffering, enables and disables drawing on a
14567 per-pixel basis. You draw into the stencil planes using GL drawing
14568 primitives, then render geometry and images, using the stencil planes to
14569 mask out portions of the screen. Stenciling is typically used in
14570 multipass rendering algorithms to achieve special effects, such as
14571 decals, outlining, and constructive solid geometry rendering.
14573 The stencil test conditionally eliminates a pixel based on the outcome
14574 of a comparison between the value in the stencil buffer and a reference
14575 value. To enable and disable the test, call `glEnable' and `glDisable'
14576 with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
14577 `glStencilFuncSeparate'.
14579 There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
14580 one affects back-facing polygons, and the other affects front-facing
14581 polygons as well as other non-polygon primitives. `glStencilOp' sets
14582 both front and back stencil state to the same values, as if
14583 `glStencilOpSeparate' were called with FACE set to `GL_FRONT_AND_BACK'.
14585 `glStencilOpSeparate' takes three arguments that indicate what happens
14586 to the stored stencil value while stenciling is enabled. If the stencil
14587 test fails, no change is made to the pixel's color or depth buffers, and
14588 SFAIL specifies what happens to the stencil buffer contents. The
14589 following eight actions are possible.
14592 Keeps the current value.
14595 Sets the stencil buffer value to 0.
14598 Sets the stencil buffer value to REF, as specified by
14602 Increments the current stencil buffer value. Clamps to the maximum
14603 representable unsigned value.
14606 Increments the current stencil buffer value. Wraps stencil buffer
14607 value to zero when incrementing the maximum representable unsigned
14611 Decrements the current stencil buffer value. Clamps to 0.
14614 Decrements the current stencil buffer value. Wraps stencil buffer
14615 value to the maximum representable unsigned value when decrementing
14616 a stencil buffer value of zero.
14619 Bitwise inverts the current stencil buffer value.
14621 Stencil buffer values are treated as unsigned integers. When incremented
14622 and decremented, values are clamped to 0 and 2^N-1 , where N is the
14623 value returned by querying `GL_STENCIL_BITS'.
14625 The other two arguments to `glStencilOpSeparate' specify stencil buffer
14626 actions that depend on whether subsequent depth buffer tests succeed
14627 (DPPASS) or fail (DPFAIL) (see `glDepthFunc'). The actions are specified
14628 using the same eight symbolic constants as SFAIL. Note that DPFAIL is
14629 ignored when there is no depth buffer, or when the depth buffer is not
14630 enabled. In these cases, SFAIL and DPPASS specify stencil action when
14631 the stencil test fails and passes, respectively.
14633 `GL_INVALID_ENUM' is generated if FACE is any value other than
14634 `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
14636 `GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
14637 other than the eight defined constant values.
14639 `GL_INVALID_OPERATION' is generated if `glStencilOpSeparate' is executed
14640 between the execution of `glBegin' and the corresponding execution of
14643 (define-gl-procedures
14650 "Set front and back stencil test actions.
14653 Specifies the action to take when the stencil test fails. Eight
14654 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
14655 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
14656 and `GL_INVERT'. The initial value is `GL_KEEP'.
14659 Specifies the stencil action when the stencil test passes, but the
14660 depth test fails. DPFAIL accepts the same symbolic constants as
14661 SFAIL. The initial value is `GL_KEEP'.
14664 Specifies the stencil action when both the stencil test and the
14665 depth test pass, or when the stencil test passes and either there
14666 is no depth buffer or depth testing is not enabled. DPPASS accepts
14667 the same symbolic constants as SFAIL. The initial value is
14670 Stenciling, like depth-buffering, enables and disables drawing on a
14671 per-pixel basis. You draw into the stencil planes using GL drawing
14672 primitives, then render geometry and images, using the stencil planes to
14673 mask out portions of the screen. Stenciling is typically used in
14674 multipass rendering algorithms to achieve special effects, such as
14675 decals, outlining, and constructive solid geometry rendering.
14677 The stencil test conditionally eliminates a pixel based on the outcome
14678 of a comparison between the value in the stencil buffer and a reference
14679 value. To enable and disable the test, call `glEnable' and `glDisable'
14680 with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
14681 `glStencilFuncSeparate'.
14683 There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
14684 one affects back-facing polygons, and the other affects front-facing
14685 polygons as well as other non-polygon primitives. `glStencilOp' sets
14686 both front and back stencil state to the same values. Use
14687 `glStencilOpSeparate' to set front and back stencil state to different
14690 `glStencilOp' takes three arguments that indicate what happens to the
14691 stored stencil value while stenciling is enabled. If the stencil test
14692 fails, no change is made to the pixel's color or depth buffers, and
14693 SFAIL specifies what happens to the stencil buffer contents. The
14694 following eight actions are possible.
14697 Keeps the current value.
14700 Sets the stencil buffer value to 0.
14703 Sets the stencil buffer value to REF, as specified by
14707 Increments the current stencil buffer value. Clamps to the maximum
14708 representable unsigned value.
14711 Increments the current stencil buffer value. Wraps stencil buffer
14712 value to zero when incrementing the maximum representable unsigned
14716 Decrements the current stencil buffer value. Clamps to 0.
14719 Decrements the current stencil buffer value. Wraps stencil buffer
14720 value to the maximum representable unsigned value when decrementing
14721 a stencil buffer value of zero.
14724 Bitwise inverts the current stencil buffer value.
14726 Stencil buffer values are treated as unsigned integers. When incremented
14727 and decremented, values are clamped to 0 and 2^N-1 , where N is the
14728 value returned by querying `GL_STENCIL_BITS'.
14730 The other two arguments to `glStencilOp' specify stencil buffer actions
14731 that depend on whether subsequent depth buffer tests succeed (DPPASS) or
14732 fail (DPFAIL) (see `glDepthFunc'). The actions are specified using the
14733 same eight symbolic constants as SFAIL. Note that DPFAIL is ignored when
14734 there is no depth buffer, or when the depth buffer is not enabled. In
14735 these cases, SFAIL and DPPASS specify stencil action when the stencil
14736 test fails and passes, respectively.
14738 `GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
14739 other than the eight defined constant values.
14741 `GL_INVALID_OPERATION' is generated if `glStencilOp' is executed between
14742 the execution of `glBegin' and the corresponding execution of `glEnd'.")
14744 (define-gl-procedures
14745 ((glTexCoordPointer
14749 (pointer const-GLvoid-*)
14752 "Define an array of texture coordinates.
14755 Specifies the number of coordinates per array element. Must be 1,
14756 2, 3, or 4. The initial value is 4.
14759 Specifies the data type of each texture coordinate. Symbolic
14760 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
14761 accepted. The initial value is `GL_FLOAT'.
14764 Specifies the byte offset between consecutive texture coordinate
14765 sets. If STRIDE is 0, the array elements are understood to be
14766 tightly packed. The initial value is 0.
14769 Specifies a pointer to the first coordinate of the first texture
14770 coordinate set in the array. The initial value is 0.
14772 `glTexCoordPointer' specifies the location and data format of an array
14773 of texture coordinates to use when rendering. SIZE specifies the number
14774 of coordinates per texture coordinate set, and must be 1, 2, 3, or 4.
14775 TYPE specifies the data type of each texture coordinate, and STRIDE
14776 specifies the byte stride from one texture coordinate set to the next,
14777 allowing vertices and attributes to be packed into a single array or
14778 stored in separate arrays. (Single-array storage may be more efficient
14779 on some implementations; see `glInterleavedArrays'.)
14781 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
14782 target (see `glBindBuffer') while a texture coordinate array is
14783 specified, POINTER is treated as a byte offset into the buffer object's
14784 data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
14785 is saved as texture coordinate vertex array client-side state
14786 (`GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING').
14788 When a texture coordinate array is specified, SIZE, TYPE, STRIDE, and
14789 POINTER are saved as client-side state, in addition to the current
14790 vertex array buffer object binding.
14792 To enable and disable a texture coordinate array, call
14793 `glEnableClientState' and `glDisableClientState' with the argument
14794 `GL_TEXTURE_COORD_ARRAY'. If enabled, the texture coordinate array is
14795 used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
14796 `glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
14799 `GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
14801 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
14803 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
14805 (define-gl-procedures
14806 ((glTexCoord1i (s GLint) -> void)
14807 (glTexCoord1f (s GLfloat) -> void)
14808 (glTexCoord2i (s GLint) (t GLint) -> void)
14809 (glTexCoord2f (s GLfloat) (t GLfloat) -> void)
14836 "Set the current texture coordinates.
14845 Specify S, T, R, and Q texture coordinates. Not all parameters are
14846 present in all forms of the command.
14848 `glTexCoord' specifies texture coordinates in one, two, three, or four
14849 dimensions. `glTexCoord1' sets the current texture coordinates to
14850 (S,001) ; a call to `glTexCoord2' sets them to (S,T01) . Similarly,
14851 `glTexCoord3' specifies the texture coordinates as (S,TR1) , and
14852 `glTexCoord4' defines all four components explicitly as (S,TRQ) .
14854 The current texture coordinates are part of the data that is associated
14855 with each vertex and with the current raster position. Initially, the
14856 values for S, T, R, and Q are (0, 0, 0, 1).")
14858 (define-gl-procedures
14871 "Set texture environment parameters.
14874 Specifies a texture environment. May be `GL_TEXTURE_ENV',
14875 `GL_TEXTURE_FILTER_CONTROL' or `GL_POINT_SPRITE'.
14878 Specifies the symbolic name of a single-valued texture environment
14879 parameter. May be either `GL_TEXTURE_ENV_MODE',
14880 `GL_TEXTURE_LOD_BIAS', `GL_COMBINE_RGB', `GL_COMBINE_ALPHA',
14881 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14882 `GL_SRC1_ALPHA', `GL_SRC2_ALPHA', `GL_OPERAND0_RGB',
14883 `GL_OPERAND1_RGB', `GL_OPERAND2_RGB', `GL_OPERAND0_ALPHA',
14884 `GL_OPERAND1_ALPHA', `GL_OPERAND2_ALPHA', `GL_RGB_SCALE',
14885 `GL_ALPHA_SCALE', or `GL_COORD_REPLACE'.
14888 Specifies a single symbolic constant, one of `GL_ADD',
14889 `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_MODULATE', `GL_DECAL',
14890 `GL_BLEND', `GL_REPLACE', `GL_SUBTRACT', `GL_COMBINE',
14891 `GL_TEXTURE', `GL_CONSTANT', `GL_PRIMARY_COLOR', `GL_PREVIOUS',
14892 `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_SRC_ALPHA',
14893 `GL_ONE_MINUS_SRC_ALPHA', a single boolean value for the point
14894 sprite texture coordinate replacement, a single floating-point
14895 value for the texture level-of-detail bias, or 1.0, 2.0, or 4.0
14896 when specifying the `GL_RGB_SCALE' or `GL_ALPHA_SCALE'.
14898 A texture environment specifies how texture values are interpreted when
14899 a fragment is textured. When TARGET is `GL_TEXTURE_FILTER_CONTROL',
14900 PNAME must be `GL_TEXTURE_LOD_BIAS'. When TARGET is `GL_TEXTURE_ENV',
14901 PNAME can be `GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR',
14902 `GL_COMBINE_RGB', `GL_COMBINE_ALPHA', `GL_RGB_SCALE', `GL_ALPHA_SCALE',
14903 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14904 `GL_SRC1_ALPHA', or `GL_SRC2_ALPHA'.
14906 If PNAME is `GL_TEXTURE_ENV_MODE', then PARAMS is (or points to) the
14907 symbolic name of a texture function. Six texture functions may be
14908 specified: `GL_ADD', `GL_MODULATE', `GL_DECAL', `GL_BLEND',
14909 `GL_REPLACE', or `GL_COMBINE'.
14911 The following table shows the correspondence of filtered texture values
14912 R_T , G_T , B_T , A_T , L_T , I_T to texture source components. C_S and
14913 A_S are used by the texture functions described below.
14917 Texture Base Internal Format
14924 ( L_T , L_T , L_T ) , 1
14926 `GL_LUMINANCE_ALPHA'
14927 ( L_T , L_T , L_T ) , A_T
14930 ( I_T , I_T , I_T ) , I_T
14933 ( R_T , G_T , B_T ) , 1
14936 ( R_T , G_T , B_T ) , A_T
14938 A texture function acts on the fragment to be textured using the texture
14939 image value that applies to the fragment (see `glTexParameter') and
14940 produces an RGBA color for that fragment. The following table shows how
14941 the RGBA color is produced for each of the first five texture functions
14942 that can be chosen. C is a triple of color values (RGB) and A is the
14943 associated alpha value. RGBA values extracted from a texture image are
14944 in the range [0,1]. The subscript P refers to the color computed from
14945 the previous texture stage (or the incoming fragment if processing
14946 texture stage 0), the subscript S to the texture source color, the
14947 subscript C to the texture environment color, and the subscript V
14948 indicates a value produced by the texture function.
14952 Texture Base Internal Format
14953 `Value', `GL_REPLACE' Function , `GL_MODULATE' Function ,
14954 `GL_DECAL' Function , `GL_BLEND' Function , `GL_ADD' Function
14957 C_V= , C_P , C_P , undefined , C_P , C_P
14960 A_V= , A_S , A_P\u2062A_S , , A_V=A_P\u2062A_S , A_P\u2062A_S
14963 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14966 A_V= , A_P , A_P , , A_P , A_P
14968 `GL_LUMINANCE_ALPHA'
14969 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14972 A_V= , A_S , A_P\u2062A_S , , A_P\u2062A_S , A_P\u2062A_S
14975 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14978 A_V= , A_S , A_P\u2062A_S , , A_P\u2062(1-A_S,)+A_C\u2062A_S , A_P+A_S
14981 C_V= , C_S , C_P\u2062C_S , C_S , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14984 A_V= , A_P , A_P , A_P , A_P , A_P
14987 C_V= , C_S , C_P\u2062C_S , C_P\u2062(1-A_S,)+C_S\u2062A_S , C_P\u2062(1-C_S,)+C_C\u2062C_S
14991 A_V= , A_S , A_P\u2062A_S , A_P , A_P\u2062A_S , A_P\u2062A_S
14993 If PNAME is `GL_TEXTURE_ENV_MODE', and PARAMS is `GL_COMBINE', the form
14994 of the texture function depends on the values of `GL_COMBINE_RGB' and
14995 `GL_COMBINE_ALPHA'.
14997 The following describes how the texture sources, as specified by
14998 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14999 `GL_SRC1_ALPHA', and `GL_SRC2_ALPHA', are combined to produce a final
15000 texture color. In the following tables, `GL_SRC0_c' is represented by
15001 ARG0 , `GL_SRC1_c' is represented by ARG1 , and `GL_SRC2_c' is
15002 represented by ARG2 .
15004 `GL_COMBINE_RGB' accepts any of `GL_REPLACE', `GL_MODULATE', `GL_ADD',
15005 `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_SUBTRACT', `GL_DOT3_RGB', or
15026 ARG0×ARG2+ARG1×(1-ARG2,)
15031 `GL_DOT3_RGB' or `GL_DOT3_RGBA'
15032 4×(((ARG0_R,-0.5,)×(ARG1_R,-0.5,),)+((ARG0_G,-0.5,)×(ARG1_G,-0.5,),
15033 )+((ARG0_B,-0.5,)×(ARG1_B,-0.5,),),)
15035 The scalar results for `GL_DOT3_RGB' and `GL_DOT3_RGBA' are placed into
15036 each of the 3 (RGB) or 4 (RGBA) components on output.
15038 Likewise, `GL_COMBINE_ALPHA' accepts any of `GL_REPLACE', `GL_MODULATE',
15039 `GL_ADD', `GL_ADD_SIGNED', `GL_INTERPOLATE', or `GL_SUBTRACT'. The
15040 following table describes how alpha values are combined:
15044 *`GL_COMBINE_ALPHA'*
15060 ARG0×ARG2+ARG1×(1-ARG2,)
15065 In the following tables, the value C_S represents the color sampled from
15066 the currently bound texture, C_C represents the constant
15067 texture-environment color, C_F represents the primary color of the
15068 incoming fragment, and C_P represents the color computed from the
15069 previous texture stage or C_F if processing texture stage 0. Likewise,
15070 A_S , A_C , A_F , and A_P represent the respective alpha values.
15072 The following table describes the values assigned to ARG0 , ARG1 , and
15073 ARG2 based upon the RGB sources and operands:
15078 *`GL_OPERANDn_RGB'*, *Argument Value*
15081 `GL_SRC_COLOR', C_S,
15084 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
15087 `GL_SRC_ALPHA', A_S,
15090 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15093 `GL_SRC_COLOR', C_S,
15096 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
15099 `GL_SRC_ALPHA', A_S,
15102 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15105 `GL_SRC_COLOR', C_C,
15108 `GL_ONE_MINUS_SRC_COLOR', 1-C_C,
15111 `GL_SRC_ALPHA', A_C,
15114 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
15117 `GL_SRC_COLOR', C_F,
15120 `GL_ONE_MINUS_SRC_COLOR', 1-C_F,
15123 `GL_SRC_ALPHA', A_F,
15126 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
15129 `GL_SRC_COLOR', C_P,
15132 `GL_ONE_MINUS_SRC_COLOR', 1-C_P,
15135 `GL_SRC_ALPHA', A_P,
15138 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
15140 For `GL_TEXTUREn' sources, C_S and A_S represent the color and alpha,
15141 respectively, produced from texture stage N .
15143 The follow table describes the values assigned to ARG0 , ARG1 , and ARG2
15144 based upon the alpha sources and operands:
15149 *`GL_OPERANDn_ALPHA'*, *Argument Value*
15152 `GL_SRC_ALPHA', A_S,
15155 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15158 `GL_SRC_ALPHA', A_S,
15161 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15164 `GL_SRC_ALPHA', A_C,
15167 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
15170 `GL_SRC_ALPHA', A_F,
15173 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
15176 `GL_SRC_ALPHA', A_P,
15179 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
15181 The RGB and alpha results of the texture function are multipled by the
15182 values of `GL_RGB_SCALE' and `GL_ALPHA_SCALE', respectively, and clamped
15183 to the range [0,1] .
15185 If PNAME is `GL_TEXTURE_ENV_COLOR', PARAMS is a pointer to an array that
15186 holds an RGBA color consisting of four values. Integer color components
15187 are interpreted linearly such that the most positive integer maps to
15188 1.0, and the most negative integer maps to -1.0. The values are clamped
15189 to the range [0,1] when they are specified. C_C takes these four values.
15191 If PNAME is `GL_TEXTURE_LOD_BIAS', the value specified is added to the
15192 texture level-of-detail parameter, that selects which mipmap, or mipmaps
15193 depending upon the selected `GL_TEXTURE_MIN_FILTER', will be sampled.
15195 `GL_TEXTURE_ENV_MODE' defaults to `GL_MODULATE' and
15196 `GL_TEXTURE_ENV_COLOR' defaults to (0, 0, 0, 0).
15198 If TARGET is `GL_POINT_SPRITE' and PNAME is `GL_COORD_REPLACE', the
15199 boolean value specified is used to either enable or disable point sprite
15200 texture coordinate replacement. The default value is `GL_FALSE'.
15202 `GL_INVALID_ENUM' is generated when TARGET or PNAME is not one of the
15203 accepted defined values, or when PARAMS should have a defined constant
15204 value (based on the value of PNAME) and does not.
15206 `GL_INVALID_VALUE' is generated if the PARAMS value for `GL_RGB_SCALE'
15207 or `GL_ALPHA_SCALE' are not one of 1.0, 2.0, or 4.0.
15209 `GL_INVALID_OPERATION' is generated if `glTexEnv' is executed between
15210 the execution of `glBegin' and the corresponding execution of `glEnd'.")
15212 (define-gl-procedures
15225 "Control the generation of texture coordinates.
15228 Specifies a texture coordinate. Must be one of `GL_S', `GL_T',
15232 Specifies the symbolic name of the texture-coordinate generation
15233 function. Must be `GL_TEXTURE_GEN_MODE'.
15236 Specifies a single-valued texture generation parameter, one of
15237 `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP',
15238 `GL_NORMAL_MAP', or `GL_REFLECTION_MAP'.
15240 `glTexGen' selects a texture-coordinate generation function or supplies
15241 coefficients for one of the functions. COORD names one of the (S, T, R,
15242 Q) texture coordinates; it must be one of the symbols `GL_S', `GL_T',
15243 `GL_R', or `GL_Q'. PNAME must be one of three symbolic constants:
15244 `GL_TEXTURE_GEN_MODE', `GL_OBJECT_PLANE', or `GL_EYE_PLANE'. If PNAME is
15245 `GL_TEXTURE_GEN_MODE', then PARAMS chooses a mode, one of
15246 `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP', `GL_NORMAL_MAP',
15247 or `GL_REFLECTION_MAP'. If PNAME is either `GL_OBJECT_PLANE' or
15248 `GL_EYE_PLANE', PARAMS contains coefficients for the corresponding
15249 texture generation function.
15251 If the texture generation function is `GL_OBJECT_LINEAR', the function
15253 G=P_1×X_O+P_2×Y_O+P_3×Z_O+P_4×W_O
15255 is used, where G is the value computed for the coordinate named in
15256 COORD, P_1 , P_2 , P_3 , and P_4 are the four values supplied in PARAMS,
15257 and X_O , Y_O , Z_O , and W_O are the object coordinates of the vertex.
15258 This function can be used, for example, to texture-map terrain using sea
15259 level as a reference plane (defined by P_1 , P_2 , P_3 , and P_4 ). The
15260 altitude of a terrain vertex is computed by the `GL_OBJECT_LINEAR'
15261 coordinate generation function as its distance from sea level; that
15262 altitude can then be used to index the texture image to map white snow
15263 onto peaks and green grass onto foothills.
15265 If the texture generation function is `GL_EYE_LINEAR', the function
15267 G=P_1,^″×X_E+P_2,^″×Y_E+P_3,^″×Z_E+P_4,^″×W_E
15271 (P_1,^″\u2062P_2,^″\u2062P_3,^″\u2062P_4,^″,)=(P_1\u2062P_2\u2062P_3\u2062P_4,)\u2062M^-1
15273 and X_E , Y_E , Z_E , and W_E are the eye coordinates of the vertex, P_1
15274 , P_2 , P_3 , and P_4 are the values supplied in PARAMS, and M is the
15275 modelview matrix when `glTexGen' is invoked. If M is poorly conditioned
15276 or singular, texture coordinates generated by the resulting function may
15277 be inaccurate or undefined.
15279 Note that the values in PARAMS define a reference plane in eye
15280 coordinates. The modelview matrix that is applied to them may not be the
15281 same one in effect when the polygon vertices are transformed. This
15282 function establishes a field of texture coordinates that can produce
15283 dynamic contour lines on moving objects.
15285 If the texture generation function is `GL_SPHERE_MAP' and COORD is
15286 either `GL_S' or `GL_T', S and T texture coordinates are generated as
15287 follows. Let U be the unit vector pointing from the origin to the
15288 polygon vertex (in eye coordinates). Let N sup prime be the current
15289 normal, after transformation to eye coordinates. Let
15291 F=(F_X\u2062F_Y\u2062F_Z,)^T be the reflection vector such that
15293 F=U-2\u2062N^″\u2062N^″,^T\u2062U
15295 Finally, let M=2\u2062√(F_X,^2+F_Y,^2+(F_Z+1,)^2,) . Then the values assigned
15296 to the S and T texture coordinates are
15302 To enable or disable a texture-coordinate generation function, call
15303 `glEnable' or `glDisable' with one of the symbolic texture-coordinate
15304 names (`GL_TEXTURE_GEN_S', `GL_TEXTURE_GEN_T', `GL_TEXTURE_GEN_R', or
15305 `GL_TEXTURE_GEN_Q') as the argument. When enabled, the specified texture
15306 coordinate is computed according to the generating function associated
15307 with that coordinate. When disabled, subsequent vertices take the
15308 specified texture coordinate from the current set of texture
15309 coordinates. Initially, all texture generation functions are set to
15310 `GL_EYE_LINEAR' and are disabled. Both S plane equations are (1, 0, 0,
15311 0), both T plane equations are (0, 1, 0, 0), and all R and Q plane
15312 equations are (0, 0, 0, 0).
15314 When the `ARB_multitexture' extension is supported, `glTexGen' sets the
15315 texture generation parameters for the currently active texture unit,
15316 selected with `glActiveTexture'.
15318 `GL_INVALID_ENUM' is generated when COORD or PNAME is not an accepted
15319 defined value, or when PNAME is `GL_TEXTURE_GEN_MODE' and PARAMS is not
15320 an accepted defined value.
15322 `GL_INVALID_ENUM' is generated when PNAME is `GL_TEXTURE_GEN_MODE',
15323 PARAMS is `GL_SPHERE_MAP', and COORD is either `GL_R' or `GL_Q'.
15325 `GL_INVALID_OPERATION' is generated if `glTexGen' is executed between
15326 the execution of `glBegin' and the corresponding execution of `glEnd'.")
15328 (define-gl-procedures
15332 (internalFormat GLint)
15337 (data const-GLvoid-*)
15340 "Specify a one-dimensional texture image.
15343 Specifies the target texture. Must be `GL_TEXTURE_1D' or
15344 `GL_PROXY_TEXTURE_1D'.
15347 Specifies the level-of-detail number. Level 0 is the base image
15348 level. Level N is the Nth mipmap reduction image.
15351 Specifies the number of color components in the texture. Must be 1,
15352 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
15353 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15354 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
15355 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
15356 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
15357 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
15358 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
15359 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
15360 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15361 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15362 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15363 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
15364 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
15365 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
15366 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
15367 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
15368 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
15369 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
15373 Specifies the width of the texture image including the border if
15374 any. If the GL version does not support non-power-of-two sizes,
15375 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
15376 implementations support texture images that are at least 64 texels
15377 wide. The height of the 1D texture image is 1.
15380 Specifies the width of the border. Must be either 0 or 1.
15383 Specifies the format of the pixel data. The following symbolic
15384 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
15385 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
15386 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
15389 Specifies the data type of the pixel data. The following symbolic
15390 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
15391 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
15392 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15393 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
15394 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15395 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15396 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15397 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
15400 Specifies a pointer to the image data in memory.
15402 Texturing maps a portion of a specified texture image onto each
15403 graphical primitive for which texturing is enabled. To enable and
15404 disable one-dimensional texturing, call `glEnable' and `glDisable' with
15405 argument `GL_TEXTURE_1D'.
15407 Texture images are defined with `glTexImage1D'. The arguments describe
15408 the parameters of the texture image, such as width, width of the border,
15409 level-of-detail number (see `glTexParameter'), and the internal
15410 resolution and format used to store the image. The last three arguments
15411 describe how the image is represented in memory; they are identical to
15412 the pixel formats used for `glDrawPixels'.
15414 If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
15415 of the texture image state is recalculated, checked for consistency, and
15416 checked against the implementation's capabilities. If the implementation
15417 cannot handle a texture of the requested texture size, it sets all of
15418 the image state to 0, but does not generate an error (see `glGetError').
15419 To query for an entire mipmap array, use an image array level greater
15420 than or equal to 1.
15422 If TARGET is `GL_TEXTURE_1D', data is read from DATA as a sequence of
15423 signed or unsigned bytes, shorts, or longs, or single-precision
15424 floating-point values, depending on TYPE. These values are grouped into
15425 sets of one, two, three, or four values, depending on FORMAT, to form
15426 elements. If TYPE is `GL_BITMAP', the data is considered as a string of
15427 unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
15428 treated as eight 1-bit elements, with bit ordering determined by
15429 `GL_UNPACK_LSB_FIRST' (see `glPixelStore').
15431 If a non-zero named buffer object is bound to the
15432 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
15433 image is specified, DATA is treated as a byte offset into the buffer
15434 object's data store.
15436 The first element corresponds to the left end of the texture array.
15437 Subsequent elements progress left-to-right through the remaining texels
15438 in the texture array. The final element corresponds to the right end of
15441 FORMAT determines the composition of each element in DATA. It can assume
15442 one of these symbolic values:
15445 Each element is a single value, a color index. The GL converts it
15446 to fixed point (with an unspecified number of zero bits to the
15447 right of the binary point), shifted left or right depending on the
15448 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
15449 (see `glPixelTransfer'). The resulting index is converted to a set
15450 of color components using the `GL_PIXEL_MAP_I_TO_R',
15451 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
15452 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
15455 Each element is a single red component. The GL converts it to
15456 floating point and assembles it into an RGBA element by attaching 0
15457 for green and blue, and 1 for alpha. Each component is then
15458 multiplied by the signed scale factor `GL_c_SCALE', added to the
15459 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15460 `glPixelTransfer').
15463 Each element is a single green component. The GL converts it to
15464 floating point and assembles it into an RGBA element by attaching 0
15465 for red and blue, and 1 for alpha. Each component is then
15466 multiplied by the signed scale factor `GL_c_SCALE', added to the
15467 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15468 `glPixelTransfer').
15471 Each element is a single blue component. The GL converts it to
15472 floating point and assembles it into an RGBA element by attaching 0
15473 for red and green, and 1 for alpha. Each component is then
15474 multiplied by the signed scale factor `GL_c_SCALE', added to the
15475 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15476 `glPixelTransfer').
15479 Each element is a single alpha component. The GL converts it to
15480 floating point and assembles it into an RGBA element by attaching 0
15481 for red, green, and blue. Each component is then multiplied by the
15482 signed scale factor `GL_c_SCALE', added to the signed bias
15483 `GL_c_BIAS', and clamped to the range [0,1] (see
15484 `glPixelTransfer').
15487 Each element is a single intensity value. The GL converts it to
15488 floating point, then assembles it into an RGBA element by
15489 replicating the intensity value three times for red, green, blue,
15490 and alpha. Each component is then multiplied by the signed scale
15491 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
15492 clamped to the range [0,1] (see `glPixelTransfer').
15496 Each element is an RGB triple. The GL converts it to floating point
15497 and assembles it into an RGBA element by attaching 1 for alpha.
15498 Each component is then multiplied by the signed scale factor
15499 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15500 the range [0,1] (see `glPixelTransfer').
15504 Each element contains all four components. Each component is
15505 multiplied by the signed scale factor `GL_c_SCALE', added to the
15506 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15507 `glPixelTransfer').
15510 Each element is a single luminance value. The GL converts it to
15511 floating point, then assembles it into an RGBA element by
15512 replicating the luminance value three times for red, green, and
15513 blue and attaching 1 for alpha. Each component is then multiplied
15514 by the signed scale factor `GL_c_SCALE', added to the signed bias
15515 `GL_c_BIAS', and clamped to the range [0,1] (see
15516 `glPixelTransfer').
15518 `GL_LUMINANCE_ALPHA'
15519 Each element is a luminance/alpha pair. The GL converts it to
15520 floating point, then assembles it into an RGBA element by
15521 replicating the luminance value three times for red, green, and
15522 blue. Each component is then multiplied by the signed scale factor
15523 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15524 the range [0,1] (see `glPixelTransfer').
15526 `GL_DEPTH_COMPONENT'
15527 Each element is a single depth value. The GL converts it to
15528 floating point, multiplies by the signed scale factor
15529 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
15530 to the range [0,1] (see `glPixelTransfer').
15532 Refer to the `glDrawPixels' reference page for a description of the
15533 acceptable values for the TYPE parameter.
15535 If an application wants to store the texture at a certain resolution or
15536 in a certain format, it can request the resolution and format with
15537 INTERNALFORMAT. The GL will choose an internal representation that
15538 closely approximates that requested by INTERNALFORMAT, but it may not
15539 match exactly. (The representations specified by `GL_LUMINANCE',
15540 `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
15541 numeric values 1, 2, 3, and 4 may also be used to specify the above
15544 If the INTERNALFORMAT parameter is one of the generic compressed
15545 formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
15546 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
15547 `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
15548 internal format with the symbolic constant for a specific internal
15549 format and compress the texture before storage. If no corresponding
15550 internal format is available, or the GL can not compress that image for
15551 any reason, the internal format is instead replaced with a corresponding
15552 base internal format.
15554 If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
15555 `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
15556 `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
15557 treated as if the red, green, blue, or luminance components are encoded
15558 in the sRGB color space. Any alpha component is left unchanged. The
15559 conversion from the sRGB encoded component C_S to a linear component C_L
15562 C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
15565 Assume C_S is the sRGB component in the range [0,1].
15567 Use the `GL_PROXY_TEXTURE_1D' target to try out a resolution and format.
15568 The implementation will update and recompute its best match for the
15569 requested storage resolution and format. To then query this state, call
15570 `glGetTexLevelParameter'. If the texture cannot be accommodated, texture
15573 A one-component texture image uses only the red component of the RGBA
15574 color from DATA. A two-component image uses the R and A values. A
15575 three-component image uses the R, G, and B values. A four-component
15576 image uses all of the RGBA components.
15578 Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
15579 during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
15580 \xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
15581 generate a boolean result. See `glTexParameter' for details on texture
15584 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_1D' or
15585 `GL_PROXY_TEXTURE_1D'.
15587 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
15588 constant. Format constants other than `GL_STENCIL_INDEX' are accepted.
15590 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
15592 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
15595 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
15597 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
15598 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
15600 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
15601 one of the accepted resolution and format symbolic constants.
15603 `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
15604 2 + `GL_MAX_TEXTURE_SIZE'.
15606 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
15607 supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
15608 some integer value of N.
15610 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
15612 `GL_INVALID_OPERATION' is generated if TYPE is one of
15613 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15614 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
15617 `GL_INVALID_OPERATION' is generated if TYPE is one of
15618 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15619 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15620 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15621 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
15622 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
15624 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
15625 and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
15626 `GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
15628 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
15629 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15630 `GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
15632 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15633 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
15634 data store is currently mapped.
15636 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15637 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
15638 unpacked from the buffer object such that the memory reads required
15639 would exceed the data store size.
15641 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15642 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
15643 divisible into the number of bytes needed to store in memory a datum
15646 `GL_INVALID_OPERATION' is generated if `glTexImage1D' is executed
15647 between the execution of `glBegin' and the corresponding execution of
15650 (define-gl-procedures
15654 (internalFormat GLint)
15660 (data const-GLvoid-*)
15663 "Specify a two-dimensional texture image.
15666 Specifies the target texture. Must be `GL_TEXTURE_2D',
15667 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
15668 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
15669 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
15670 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
15673 Specifies the level-of-detail number. Level 0 is the base image
15674 level. Level N is the Nth mipmap reduction image.
15677 Specifies the number of color components in the texture. Must be 1,
15678 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
15679 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15680 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
15681 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
15682 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
15683 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
15684 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
15685 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
15686 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15687 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15688 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15689 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
15690 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
15691 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
15692 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
15693 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
15694 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
15695 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
15699 Specifies the width of the texture image including the border if
15700 any. If the GL version does not support non-power-of-two sizes,
15701 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
15702 implementations support texture images that are at least 64 texels
15706 Specifies the height of the texture image including the border if
15707 any. If the GL version does not support non-power-of-two sizes,
15708 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
15709 implementations support texture images that are at least 64 texels
15713 Specifies the width of the border. Must be either 0 or 1.
15716 Specifies the format of the pixel data. The following symbolic
15717 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
15718 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
15719 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
15722 Specifies the data type of the pixel data. The following symbolic
15723 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
15724 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
15725 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15726 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
15727 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15728 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15729 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15730 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
15733 Specifies a pointer to the image data in memory.
15735 Texturing maps a portion of a specified texture image onto each
15736 graphical primitive for which texturing is enabled. To enable and
15737 disable two-dimensional texturing, call `glEnable' and `glDisable' with
15738 argument `GL_TEXTURE_2D'. To enable and disable texturing using
15739 cube-mapped texture, call `glEnable' and `glDisable' with argument
15740 `GL_TEXTURE_CUBE_MAP'.
15742 To define texture images, call `glTexImage2D'. The arguments describe
15743 the parameters of the texture image, such as height, width, width of the
15744 border, level-of-detail number (see `glTexParameter'), and number of
15745 color components provided. The last three arguments describe how the
15746 image is represented in memory; they are identical to the pixel formats
15747 used for `glDrawPixels'.
15749 If TARGET is `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP', no
15750 data is read from DATA, but all of the texture image state is
15751 recalculated, checked for consistency, and checked against the
15752 implementation's capabilities. If the implementation cannot handle a
15753 texture of the requested texture size, it sets all of the image state to
15754 0, but does not generate an error (see `glGetError'). To query for an
15755 entire mipmap array, use an image array level greater than or equal to
15758 If TARGET is `GL_TEXTURE_2D', or one of the `GL_TEXTURE_CUBE_MAP'
15759 targets, data is read from DATA as a sequence of signed or unsigned
15760 bytes, shorts, or longs, or single-precision floating-point values,
15761 depending on TYPE. These values are grouped into sets of one, two,
15762 three, or four values, depending on FORMAT, to form elements. If TYPE is
15763 `GL_BITMAP', the data is considered as a string of unsigned bytes (and
15764 FORMAT must be `GL_COLOR_INDEX'). Each data byte is treated as eight
15765 1-bit elements, with bit ordering determined by `GL_UNPACK_LSB_FIRST'
15766 (see `glPixelStore').
15768 If a non-zero named buffer object is bound to the
15769 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
15770 image is specified, DATA is treated as a byte offset into the buffer
15771 object's data store.
15773 The first element corresponds to the lower left corner of the texture
15774 image. Subsequent elements progress left-to-right through the remaining
15775 texels in the lowest row of the texture image, and then in successively
15776 higher rows of the texture image. The final element corresponds to the
15777 upper right corner of the texture image.
15779 FORMAT determines the composition of each element in DATA. It can assume
15780 one of these symbolic values:
15783 Each element is a single value, a color index. The GL converts it
15784 to fixed point (with an unspecified number of zero bits to the
15785 right of the binary point), shifted left or right depending on the
15786 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
15787 (see `glPixelTransfer'). The resulting index is converted to a set
15788 of color components using the `GL_PIXEL_MAP_I_TO_R',
15789 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
15790 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
15793 Each element is a single red component. The GL converts it to
15794 floating point and assembles it into an RGBA element by attaching 0
15795 for green and blue, and 1 for alpha. Each component is then
15796 multiplied by the signed scale factor `GL_c_SCALE', added to the
15797 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15798 `glPixelTransfer').
15801 Each element is a single green component. The GL converts it to
15802 floating point and assembles it into an RGBA element by attaching 0
15803 for red and blue, and 1 for alpha. Each component is then
15804 multiplied by the signed scale factor `GL_c_SCALE', added to the
15805 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15806 `glPixelTransfer').
15809 Each element is a single blue component. The GL converts it to
15810 floating point and assembles it into an RGBA element by attaching 0
15811 for red and green, and 1 for alpha. Each component is then
15812 multiplied by the signed scale factor `GL_c_SCALE', added to the
15813 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15814 `glPixelTransfer').
15817 Each element is a single alpha component. The GL converts it to
15818 floating point and assembles it into an RGBA element by attaching 0
15819 for red, green, and blue. Each component is then multiplied by the
15820 signed scale factor `GL_c_SCALE', added to the signed bias
15821 `GL_c_BIAS', and clamped to the range [0,1] (see
15822 `glPixelTransfer').
15825 Each element is a single intensity value. The GL converts it to
15826 floating point, then assembles it into an RGBA element by
15827 replicating the intensity value three times for red, green, blue,
15828 and alpha. Each component is then multiplied by the signed scale
15829 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
15830 clamped to the range [0,1] (see `glPixelTransfer').
15834 Each element is an RGB triple. The GL converts it to floating point
15835 and assembles it into an RGBA element by attaching 1 for alpha.
15836 Each component is then multiplied by the signed scale factor
15837 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15838 the range [0,1] (see `glPixelTransfer').
15842 Each element contains all four components. Each component is
15843 multiplied by the signed scale factor `GL_c_SCALE', added to the
15844 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15845 `glPixelTransfer').
15848 Each element is a single luminance value. The GL converts it to
15849 floating point, then assembles it into an RGBA element by
15850 replicating the luminance value three times for red, green, and
15851 blue and attaching 1 for alpha. Each component is then multiplied
15852 by the signed scale factor `GL_c_SCALE', added to the signed bias
15853 `GL_c_BIAS', and clamped to the range [0,1] (see
15854 `glPixelTransfer').
15856 `GL_LUMINANCE_ALPHA'
15857 Each element is a luminance/alpha pair. The GL converts it to
15858 floating point, then assembles it into an RGBA element by
15859 replicating the luminance value three times for red, green, and
15860 blue. Each component is then multiplied by the signed scale factor
15861 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15862 the range [0,1] (see `glPixelTransfer').
15864 `GL_DEPTH_COMPONENT'
15865 Each element is a single depth value. The GL converts it to
15866 floating point, multiplies by the signed scale factor
15867 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
15868 to the range [0,1] (see `glPixelTransfer').
15870 Refer to the `glDrawPixels' reference page for a description of the
15871 acceptable values for the TYPE parameter.
15873 If an application wants to store the texture at a certain resolution or
15874 in a certain format, it can request the resolution and format with
15875 INTERNALFORMAT. The GL will choose an internal representation that
15876 closely approximates that requested by INTERNALFORMAT, but it may not
15877 match exactly. (The representations specified by `GL_LUMINANCE',
15878 `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
15879 numeric values 1, 2, 3, and 4 may also be used to specify the above
15882 If the INTERNALFORMAT parameter is one of the generic compressed
15883 formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
15884 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
15885 `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
15886 internal format with the symbolic constant for a specific internal
15887 format and compress the texture before storage. If no corresponding
15888 internal format is available, or the GL can not compress that image for
15889 any reason, the internal format is instead replaced with a corresponding
15890 base internal format.
15892 If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
15893 `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
15894 `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
15895 treated as if the red, green, blue, or luminance components are encoded
15896 in the sRGB color space. Any alpha component is left unchanged. The
15897 conversion from the sRGB encoded component C_S to a linear component C_L
15900 C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
15903 Assume C_S is the sRGB component in the range [0,1].
15905 Use the `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP' target to
15906 try out a resolution and format. The implementation will update and
15907 recompute its best match for the requested storage resolution and
15908 format. To then query this state, call `glGetTexLevelParameter'. If the
15909 texture cannot be accommodated, texture state is set to 0.
15911 A one-component texture image uses only the red component of the RGBA
15912 color extracted from DATA. A two-component image uses the R and A
15913 values. A three-component image uses the R, G, and B values. A
15914 four-component image uses all of the RGBA components.
15916 Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
15917 during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
15918 \xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
15919 generate a boolean result. See `glTexParameter' for details on texture
15922 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
15923 `GL_PROXY_TEXTURE_2D', `GL_PROXY_TEXTURE_CUBE_MAP',
15924 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
15925 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
15926 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
15928 `GL_INVALID_ENUM' is generated if TARGET is one of the six cube map 2D
15929 image targets and the width and height parameters are not equal.
15931 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
15933 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
15936 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
15937 greater than 2 + `GL_MAX_TEXTURE_SIZE'.
15939 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
15941 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
15942 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
15944 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
15945 one of the accepted resolution and format symbolic constants.
15947 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
15948 greater than 2 + `GL_MAX_TEXTURE_SIZE'.
15950 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
15951 supported and the WIDTH or HEIGHT cannot be represented as
15952 2^K+2\u2061(BORDER,) for some integer value of K.
15954 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
15956 `GL_INVALID_OPERATION' is generated if TYPE is one of
15957 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15958 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
15961 `GL_INVALID_OPERATION' is generated if TYPE is one of
15962 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15963 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15964 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15965 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
15966 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
15968 `GL_INVALID_OPERATION' is generated if TARGET is not `GL_TEXTURE_2D' or
15969 `GL_PROXY_TEXTURE_2D' and INTERNALFORMAT is `GL_DEPTH_COMPONENT',
15970 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15971 `GL_DEPTH_COMPONENT32'.
15973 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
15974 and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
15975 `GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
15977 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
15978 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15979 `GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
15981 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15982 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
15983 data store is currently mapped.
15985 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15986 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
15987 unpacked from the buffer object such that the memory reads required
15988 would exceed the data store size.
15990 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15991 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
15992 divisible into the number of bytes needed to store in memory a datum
15995 `GL_INVALID_OPERATION' is generated if `glTexImage2D' is executed
15996 between the execution of `glBegin' and the corresponding execution of
15999 (define-gl-procedures
16003 (internalFormat GLint)
16010 (data const-GLvoid-*)
16013 "Specify a three-dimensional texture image.
16016 Specifies the target texture. Must be `GL_TEXTURE_3D' or
16017 `GL_PROXY_TEXTURE_3D'.
16020 Specifies the level-of-detail number. Level 0 is the base image
16021 level. Level N is the N^TH mipmap reduction image.
16024 Specifies the number of color components in the texture. Must be 1,
16025 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
16026 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
16027 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
16028 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
16029 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_LUMINANCE',
16030 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
16031 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
16032 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
16033 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
16034 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
16035 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
16036 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
16037 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
16038 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
16039 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
16040 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
16044 Specifies the width of the texture image including the border if
16045 any. If the GL version does not support non-power-of-two sizes,
16046 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
16047 implementations support 3D texture images that are at least 16
16051 Specifies the height of the texture image including the border if
16052 any. If the GL version does not support non-power-of-two sizes,
16053 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
16054 implementations support 3D texture images that are at least 16
16058 Specifies the depth of the texture image including the border if
16059 any. If the GL version does not support non-power-of-two sizes,
16060 this value must be 2^K+2\u2061(BORDER,) for some integer K . All
16061 implementations support 3D texture images that are at least 16
16065 Specifies the width of the border. Must be either 0 or 1.
16068 Specifies the format of the pixel data. The following symbolic
16069 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16070 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16071 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16074 Specifies the data type of the pixel data. The following symbolic
16075 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16076 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16077 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16078 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16079 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16080 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16081 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16082 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16085 Specifies a pointer to the image data in memory.
16087 Texturing maps a portion of a specified texture image onto each
16088 graphical primitive for which texturing is enabled. To enable and
16089 disable three-dimensional texturing, call `glEnable' and `glDisable'
16090 with argument `GL_TEXTURE_3D'.
16092 To define texture images, call `glTexImage3D'. The arguments describe
16093 the parameters of the texture image, such as height, width, depth, width
16094 of the border, level-of-detail number (see `glTexParameter'), and number
16095 of color components provided. The last three arguments describe how the
16096 image is represented in memory; they are identical to the pixel formats
16097 used for `glDrawPixels'.
16099 If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
16100 of the texture image state is recalculated, checked for consistency, and
16101 checked against the implementation's capabilities. If the implementation
16102 cannot handle a texture of the requested texture size, it sets all of
16103 the image state to 0, but does not generate an error (see `glGetError').
16104 To query for an entire mipmap array, use an image array level greater
16105 than or equal to 1.
16107 If TARGET is `GL_TEXTURE_3D', data is read from DATA as a sequence of
16108 signed or unsigned bytes, shorts, or longs, or single-precision
16109 floating-point values, depending on TYPE. These values are grouped into
16110 sets of one, two, three, or four values, depending on FORMAT, to form
16111 elements. If TYPE is `GL_BITMAP', the data is considered as a string of
16112 unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
16113 treated as eight 1-bit elements, with bit ordering determined by
16114 `GL_UNPACK_LSB_FIRST' (see `glPixelStore').
16116 If a non-zero named buffer object is bound to the
16117 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16118 image is specified, DATA is treated as a byte offset into the buffer
16119 object's data store.
16121 The first element corresponds to the lower left corner of the texture
16122 image. Subsequent elements progress left-to-right through the remaining
16123 texels in the lowest row of the texture image, and then in successively
16124 higher rows of the texture image. The final element corresponds to the
16125 upper right corner of the texture image.
16127 FORMAT determines the composition of each element in DATA. It can assume
16128 one of these symbolic values:
16131 Each element is a single value, a color index. The GL converts it
16132 to fixed point (with an unspecified number of zero bits to the
16133 right of the binary point), shifted left or right depending on the
16134 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
16135 (see `glPixelTransfer'). The resulting index is converted to a set
16136 of color components using the `GL_PIXEL_MAP_I_TO_R',
16137 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
16138 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
16141 Each element is a single red component. The GL converts it to
16142 floating point and assembles it into an RGBA element by attaching 0
16143 for green and blue, and 1 for alpha. Each component is then
16144 multiplied by the signed scale factor `GL_c_SCALE', added to the
16145 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16146 `glPixelTransfer').
16149 Each element is a single green component. The GL converts it to
16150 floating point and assembles it into an RGBA element by attaching 0
16151 for red and blue, and 1 for alpha. Each component is then
16152 multiplied by the signed scale factor `GL_c_SCALE', added to the
16153 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16154 `glPixelTransfer').
16157 Each element is a single blue component. The GL converts it to
16158 floating point and assembles it into an RGBA element by attaching 0
16159 for red and green, and 1 for alpha. Each component is then
16160 multiplied by the signed scale factor `GL_c_SCALE', added to the
16161 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16162 `glPixelTransfer').
16165 Each element is a single alpha component. The GL converts it to
16166 floating point and assembles it into an RGBA element by attaching 0
16167 for red, green, and blue. Each component is then multiplied by the
16168 signed scale factor `GL_c_SCALE', added to the signed bias
16169 `GL_c_BIAS', and clamped to the range [0,1] (see
16170 `glPixelTransfer').
16173 Each element is a single intensity value. The GL converts it to
16174 floating point, then assembles it into an RGBA element by
16175 replicating the intensity value three times for red, green, blue,
16176 and alpha. Each component is then multiplied by the signed scale
16177 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
16178 clamped to the range [0,1] (see `glPixelTransfer').
16182 Each element is an RGB triple. The GL converts it to floating point
16183 and assembles it into an RGBA element by attaching 1 for alpha.
16184 Each component is then multiplied by the signed scale factor
16185 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
16186 the range [0,1] (see `glPixelTransfer').
16190 Each element contains all four components. Each component is
16191 multiplied by the signed scale factor `GL_c_SCALE', added to the
16192 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16193 `glPixelTransfer').
16196 Each element is a single luminance value. The GL converts it to
16197 floating point, then assembles it into an RGBA element by
16198 replicating the luminance value three times for red, green, and
16199 blue and attaching 1 for alpha. Each component is then multiplied
16200 by the signed scale factor `GL_c_SCALE', added to the signed bias
16201 `GL_c_BIAS', and clamped to the range [0,1] (see
16202 `glPixelTransfer').
16204 `GL_LUMINANCE_ALPHA'
16205 Each element is a luminance/alpha pair. The GL converts it to
16206 floating point, then assembles it into an RGBA element by
16207 replicating the luminance value three times for red, green, and
16208 blue. Each component is then multiplied by the signed scale factor
16209 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
16210 the range [0,1] (see `glPixelTransfer').
16212 Refer to the `glDrawPixels' reference page for a description of the
16213 acceptable values for the TYPE parameter.
16215 If an application wants to store the texture at a certain resolution or
16216 in a certain format, it can request the resolution and format with
16217 INTERNALFORMAT. The GL will choose an internal representation that
16218 closely approximates that requested by INTERNALFORMAT, but it may not
16219 match exactly. (The representations specified by `GL_LUMINANCE',
16220 `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
16221 numeric values 1, 2, 3, and 4 may also be used to specify the above
16224 If the INTERNALFORMAT parameter is one of the generic compressed
16225 formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
16226 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
16227 `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
16228 internal format with the symbolic constant for a specific internal
16229 format and compress the texture before storage. If no corresponding
16230 internal format is available, or the GL can not compress that image for
16231 any reason, the internal format is instead replaced with a corresponding
16232 base internal format.
16234 If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
16235 `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
16236 `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
16237 treated as if the red, green, blue, or luminance components are encoded
16238 in the sRGB color space. Any alpha component is left unchanged. The
16239 conversion from the sRGB encoded component C_S to a linear component C_L
16242 C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
16245 Assume C_S is the sRGB component in the range [0,1].
16247 Use the `GL_PROXY_TEXTURE_3D' target to try out a resolution and format.
16248 The implementation will update and recompute its best match for the
16249 requested storage resolution and format. To then query this state, call
16250 `glGetTexLevelParameter'. If the texture cannot be accommodated, texture
16253 A one-component texture image uses only the red component of the RGBA
16254 color extracted from DATA. A two-component image uses the R and A
16255 values. A three-component image uses the R, G, and B values. A
16256 four-component image uses all of the RGBA components.
16258 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_3D' or
16259 `GL_PROXY_TEXTURE_3D'.
16261 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16262 constant. Format constants other than `GL_STENCIL_INDEX' and
16263 `GL_DEPTH_COMPONENT' are accepted.
16265 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16267 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16270 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16272 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
16273 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16275 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
16276 one of the accepted resolution and format symbolic constants.
16278 `GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
16279 0 or greater than 2 + `GL_MAX_TEXTURE_SIZE'.
16281 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
16282 supported and the WIDTH, HEIGHT, or DEPTH cannot be represented as
16283 2^K+2\u2061(BORDER,) for some integer value of K.
16285 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
16287 `GL_INVALID_OPERATION' is generated if TYPE is one of
16288 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16289 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16292 `GL_INVALID_OPERATION' is generated if TYPE is one of
16293 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16294 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16295 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16296 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16297 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16299 `GL_INVALID_OPERATION' is generated if FORMAT or INTERNALFORMAT is
16300 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
16301 `GL_DEPTH_COMPONENT32'.
16303 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16304 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16305 data store is currently mapped.
16307 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16308 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16309 unpacked from the buffer object such that the memory reads required
16310 would exceed the data store size.
16312 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16313 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16314 divisible into the number of bytes needed to store in memory a datum
16317 `GL_INVALID_OPERATION' is generated if `glTexImage3D' is executed
16318 between the execution of `glBegin' and the corresponding execution of
16321 (define-gl-procedures
16334 "Set texture parameters.
16337 Specifies the target texture, which must be either `GL_TEXTURE_1D',
16338 `GL_TEXTURE_2D', `GL_TEXTURE_3D', or `GL_TEXTURE_CUBE_MAP'.
16341 Specifies the symbolic name of a single-valued texture parameter.
16342 PNAME can be one of the following: `GL_TEXTURE_MIN_FILTER',
16343 `GL_TEXTURE_MAG_FILTER', `GL_TEXTURE_MIN_LOD',
16344 `GL_TEXTURE_MAX_LOD', `GL_TEXTURE_BASE_LEVEL',
16345 `GL_TEXTURE_MAX_LEVEL', `GL_TEXTURE_WRAP_S', `GL_TEXTURE_WRAP_T',
16346 `GL_TEXTURE_WRAP_R', `GL_TEXTURE_PRIORITY',
16347 `GL_TEXTURE_COMPARE_MODE', `GL_TEXTURE_COMPARE_FUNC',
16348 `GL_DEPTH_TEXTURE_MODE', or `GL_GENERATE_MIPMAP'.
16351 Specifies the value of PNAME.
16353 Texture mapping is a technique that applies an image onto an object's
16354 surface as if the image were a decal or cellophane shrink-wrap. The
16355 image is created in texture space, with an (S , T ) coordinate system. A
16356 texture is a one- or two-dimensional image and a set of parameters that
16357 determine how samples are derived from the image.
16359 `glTexParameter' assigns the value or values in PARAMS to the texture
16360 parameter specified as PNAME. TARGET defines the target texture, either
16361 `GL_TEXTURE_1D', `GL_TEXTURE_2D', or `GL_TEXTURE_3D'. The following
16362 symbols are accepted in PNAME:
16364 `GL_TEXTURE_MIN_FILTER'
16365 The texture minifying function is used whenever the pixel being
16366 textured maps to an area greater than one texture element. There
16367 are six defined minifying functions. Two of them use the nearest
16368 one or nearest four texture elements to compute the texture value.
16369 The other four use mipmaps.
16371 A mipmap is an ordered set of arrays representing the same image at
16372 progressively lower resolutions. If the texture has dimensions
16373 2^N×2^M , there are MAX\u2061(N,M)+1 mipmaps. The first mipmap is the
16374 original texture, with dimensions 2^N×2^M . Each subsequent mipmap
16375 has dimensions 2^K-1,×2^L-1, , where 2^K×2^L are the dimensions of
16376 the previous mipmap, until either K=0 or L=0 . At that point,
16377 subsequent mipmaps have dimension 1×2^L-1, or 2^K-1,×1 until the
16378 final mipmap, which has dimension 1×1 . To define the mipmaps, call
16379 `glTexImage1D', `glTexImage2D', `glTexImage3D', `glCopyTexImage1D',
16380 or `glCopyTexImage2D' with the LEVEL argument indicating the order
16381 of the mipmaps. Level 0 is the original texture; level MAX\u2061(N,M) is
16382 the final 1×1 mipmap.
16384 PARAMS supplies a function for minifying the texture as one of the
16387 As more texture elements are sampled in the minification process,
16388 fewer aliasing artifacts will be apparent. While the `GL_NEAREST'
16389 and `GL_LINEAR' minification functions can be faster than the other
16390 four, they sample only one or four texture elements to determine
16391 the texture value of the pixel being rendered and can produce moire
16392 patterns or ragged transitions. The initial value of
16393 `GL_TEXTURE_MIN_FILTER' is `GL_NEAREST_MIPMAP_LINEAR'.
16395 `GL_TEXTURE_MAG_FILTER'
16396 The texture magnification function is used when the pixel being
16397 textured maps to an area less than or equal to one texture element.
16398 It sets the texture magnification function to either `GL_NEAREST'
16399 or `GL_LINEAR' (see below). `GL_NEAREST' is generally faster than
16400 `GL_LINEAR', but it can produce textured images with sharper edges
16401 because the transition between texture elements is not as smooth.
16402 The initial value of `GL_TEXTURE_MAG_FILTER' is `GL_LINEAR'.
16405 Returns the value of the texture element that is nearest (in
16406 Manhattan distance) to the center of the pixel being textured.
16409 Returns the weighted average of the four texture elements that are
16410 closest to the center of the pixel being textured. These can
16411 include border texture elements, depending on the values of
16412 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
16415 `GL_NEAREST_MIPMAP_NEAREST'
16416 Chooses the mipmap that most closely matches the size of the pixel
16417 being textured and uses the `GL_NEAREST' criterion (the texture
16418 element nearest to the center of the pixel) to produce a texture
16421 `GL_LINEAR_MIPMAP_NEAREST'
16422 Chooses the mipmap that most closely matches the size of the pixel
16423 being textured and uses the `GL_LINEAR' criterion (a weighted
16424 average of the four texture elements that are closest to the center
16425 of the pixel) to produce a texture value.
16427 `GL_NEAREST_MIPMAP_LINEAR'
16428 Chooses the two mipmaps that most closely match the size of the
16429 pixel being textured and uses the `GL_NEAREST' criterion (the
16430 texture element nearest to the center of the pixel) to produce a
16431 texture value from each mipmap. The final texture value is a
16432 weighted average of those two values.
16434 `GL_LINEAR_MIPMAP_LINEAR'
16435 Chooses the two mipmaps that most closely match the size of the
16436 pixel being textured and uses the `GL_LINEAR' criterion (a weighted
16437 average of the four texture elements that are closest to the center
16438 of the pixel) to produce a texture value from each mipmap. The
16439 final texture value is a weighted average of those two values.
16442 Returns the value of the texture element that is nearest (in
16443 Manhattan distance) to the center of the pixel being textured.
16446 Returns the weighted average of the four texture elements that are
16447 closest to the center of the pixel being textured. These can
16448 include border texture elements, depending on the values of
16449 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
16454 `GL_TEXTURE_MIN_LOD'
16455 Sets the minimum level-of-detail parameter. This floating-point
16456 value limits the selection of highest resolution mipmap (lowest
16457 mipmap level). The initial value is -1000.
16461 `GL_TEXTURE_MAX_LOD'
16462 Sets the maximum level-of-detail parameter. This floating-point
16463 value limits the selection of the lowest resolution mipmap (highest
16464 mipmap level). The initial value is 1000.
16468 `GL_TEXTURE_BASE_LEVEL'
16469 Specifies the index of the lowest defined mipmap level. This is an
16470 integer value. The initial value is 0.
16474 `GL_TEXTURE_MAX_LEVEL'
16475 Sets the index of the highest defined mipmap level. This is an
16476 integer value. The initial value is 1000.
16480 `GL_TEXTURE_WRAP_S'
16481 Sets the wrap parameter for texture coordinate S to either
16482 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16483 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. `GL_CLAMP' causes S
16484 coordinates to be clamped to the range [0,1] and is useful for
16485 preventing wrapping artifacts when mapping a single image onto an
16486 object. `GL_CLAMP_TO_BORDER' causes the S coordinate to be clamped
16487 to the range [-1/2N,,1+1/2N,] , where N is the size of the texture
16488 in the direction of clamping.`GL_CLAMP_TO_EDGE' causes S
16489 coordinates to be clamped to the range [1/2N,,1-1/2N,] , where N is
16490 the size of the texture in the direction of clamping. `GL_REPEAT'
16491 causes the integer part of the S coordinate to be ignored; the GL
16492 uses only the fractional part, thereby creating a repeating
16493 pattern. `GL_MIRRORED_REPEAT' causes the S coordinate to be set to
16494 the fractional part of the texture coordinate if the integer part
16495 of S is even; if the integer part of S is odd, then the S texture
16496 coordinate is set to 1-FRAC\u2061(S,) , where FRAC\u2061(S,) represents the
16497 fractional part of S . Border texture elements are accessed only if
16498 wrapping is set to `GL_CLAMP' or `GL_CLAMP_TO_BORDER'. Initially,
16499 `GL_TEXTURE_WRAP_S' is set to `GL_REPEAT'.
16503 `GL_TEXTURE_WRAP_T'
16504 Sets the wrap parameter for texture coordinate T to either
16505 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16506 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
16507 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_T' is set to
16510 `GL_TEXTURE_WRAP_R'
16511 Sets the wrap parameter for texture coordinate R to either
16512 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16513 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
16514 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_R' is set to
16517 `GL_TEXTURE_BORDER_COLOR'
16518 Sets a border color. PARAMS contains four values that comprise the
16519 RGBA color of the texture border. Integer color components are
16520 interpreted linearly such that the most positive integer maps to
16521 1.0, and the most negative integer maps to -1.0. The values are
16522 clamped to the range [0,1] when they are specified. Initially, the
16523 border color is (0, 0, 0, 0).
16525 `GL_TEXTURE_PRIORITY'
16526 Specifies the texture residence priority of the currently bound
16527 texture. Permissible values are in the range [0,1] . See
16528 `glPrioritizeTextures' and `glBindTexture' for more information.
16530 `GL_TEXTURE_COMPARE_MODE'
16531 Specifies the texture comparison mode for currently bound depth
16532 textures. That is, a texture whose internal format is
16533 `GL_DEPTH_COMPONENT_*'; see `glTexImage2D') Permissible values are:
16535 `GL_TEXTURE_COMPARE_FUNC'
16536 Specifies the comparison operator used when
16537 `GL_TEXTURE_COMPARE_MODE' is set to `GL_COMPARE_R_TO_TEXTURE'.
16538 Permissible values are: where R is the current interpolated texture
16539 coordinate, and D_T is the depth texture value sampled from the
16540 currently bound depth texture. RESULT is assigned to the either the
16541 luminance, intensity, or alpha (as specified by
16542 `GL_DEPTH_TEXTURE_MODE'.)
16544 `GL_DEPTH_TEXTURE_MODE'
16545 Specifies a single symbolic constant indicating how depth values
16546 should be treated during filtering and texture application.
16547 Accepted values are `GL_LUMINANCE', `GL_INTENSITY', and `GL_ALPHA'.
16548 The initial value is `GL_LUMINANCE'.
16550 `GL_GENERATE_MIPMAP'
16551 Specifies a boolean value that indicates if all levels of a mipmap
16552 array should be automatically updated when any modification to the
16553 base level mipmap is done. The initial value is `GL_FALSE'.
16555 `GL_COMPARE_R_TO_TEXTURE'
16556 Specifies that the interpolated and clamped R texture coordinate
16557 should be compared to the value in the currently bound depth
16558 texture. See the discussion of `GL_TEXTURE_COMPARE_FUNC' for
16559 details of how the comparison is evaluated. The result of the
16560 comparison is assigned to luminance, intensity, or alpha (as
16561 specified by `GL_DEPTH_TEXTURE_MODE').
16564 Specifies that the luminance, intensity, or alpha (as specified by
16565 `GL_DEPTH_TEXTURE_MODE') should be assigned the appropriate value
16566 from the currently bound depth texture.
16568 *Texture Comparison Function*
16572 RESULT={(1.0), (0.0)\u2062\xa0(R<=D_T,), (R>D_T,),
16575 RESULT={(1.0), (0.0)\u2062\xa0(R>=D_T,), (R<D_T,),
16578 RESULT={(1.0), (0.0)\u2062\xa0(R<D_T,), (R>=D_T,),
16581 RESULT={(1.0), (0.0)\u2062\xa0(R>D_T,), (R<=D_T,),
16584 RESULT={(1.0), (0.0)\u2062\xa0(R=D_T,), (R≠D_T,),
16587 RESULT={(1.0), (0.0)\u2062\xa0(R≠D_T,), (R=D_T,),
16595 `GL_INVALID_ENUM' is generated if TARGET or PNAME is not one of the
16596 accepted defined values.
16598 `GL_INVALID_ENUM' is generated if PARAMS should have a defined constant
16599 value (based on the value of PNAME) and does not.
16601 `GL_INVALID_OPERATION' is generated if `glTexParameter' is executed
16602 between the execution of `glBegin' and the corresponding execution of
16605 (define-gl-procedures
16613 (data const-GLvoid-*)
16616 "Specify a one-dimensional texture subimage.
16619 Specifies the target texture. Must be `GL_TEXTURE_1D'.
16622 Specifies the level-of-detail number. Level 0 is the base image
16623 level. Level N is the Nth mipmap reduction image.
16626 Specifies a texel offset in the x direction within the texture
16630 Specifies the width of the texture subimage.
16633 Specifies the format of the pixel data. The following symbolic
16634 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16635 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16636 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16639 Specifies the data type of the pixel data. The following symbolic
16640 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16641 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16642 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16643 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16644 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16645 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16646 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16647 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16650 Specifies a pointer to the image data in memory.
16652 Texturing maps a portion of a specified texture image onto each
16653 graphical primitive for which texturing is enabled. To enable or disable
16654 one-dimensional texturing, call `glEnable' and `glDisable' with argument
16657 `glTexSubImage1D' redefines a contiguous subregion of an existing
16658 one-dimensional texture image. The texels referenced by DATA replace the
16659 portion of the existing texture array with x indices XOFFSET and
16660 XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
16661 outside the range of the texture array as it was originally specified.
16662 It is not an error to specify a subtexture with width of 0, but such a
16663 specification has no effect.
16665 If a non-zero named buffer object is bound to the
16666 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16667 image is specified, DATA is treated as a byte offset into the buffer
16668 object's data store.
16670 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
16673 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16676 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16678 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16681 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16683 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16684 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16686 `GL_INVALID_VALUE' is generated if XOFFSET<-B , or if
16687 (XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH', and B is
16688 the width of the `GL_TEXTURE_BORDER' of the texture image being
16689 modified. Note that W includes twice the border width.
16691 `GL_INVALID_VALUE' is generated if WIDTH is less than 0.
16693 `GL_INVALID_OPERATION' is generated if the texture array has not been
16694 defined by a previous `glTexImage1D' operation.
16696 `GL_INVALID_OPERATION' is generated if TYPE is one of
16697 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16698 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16701 `GL_INVALID_OPERATION' is generated if TYPE is one of
16702 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16703 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16704 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16705 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16706 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16708 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16709 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16710 data store is currently mapped.
16712 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16713 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16714 unpacked from the buffer object such that the memory reads required
16715 would exceed the data store size.
16717 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16718 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16719 divisible into the number of bytes needed to store in memory a datum
16722 `GL_INVALID_OPERATION' is generated if `glTexSubImage1D' is executed
16723 between the execution of `glBegin' and the corresponding execution of
16726 (define-gl-procedures
16736 (data const-GLvoid-*)
16739 "Specify a two-dimensional texture subimage.
16742 Specifies the target texture. Must be `GL_TEXTURE_2D',
16743 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
16744 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
16745 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
16746 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
16749 Specifies the level-of-detail number. Level 0 is the base image
16750 level. Level N is the Nth mipmap reduction image.
16753 Specifies a texel offset in the x direction within the texture
16757 Specifies a texel offset in the y direction within the texture
16761 Specifies the width of the texture subimage.
16764 Specifies the height of the texture subimage.
16767 Specifies the format of the pixel data. The following symbolic
16768 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16769 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16770 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16773 Specifies the data type of the pixel data. The following symbolic
16774 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16775 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16776 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16777 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16778 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16779 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16780 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16781 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16784 Specifies a pointer to the image data in memory.
16786 Texturing maps a portion of a specified texture image onto each
16787 graphical primitive for which texturing is enabled. To enable and
16788 disable two-dimensional texturing, call `glEnable' and `glDisable' with
16789 argument `GL_TEXTURE_2D'.
16791 `glTexSubImage2D' redefines a contiguous subregion of an existing
16792 two-dimensional texture image. The texels referenced by DATA replace the
16793 portion of the existing texture array with x indices XOFFSET and
16794 XOFFSET+WIDTH-1 , inclusive, and y indices YOFFSET and YOFFSET+HEIGHT-1
16795 , inclusive. This region may not include any texels outside the range of
16796 the texture array as it was originally specified. It is not an error to
16797 specify a subtexture with zero width or height, but such a specification
16800 If a non-zero named buffer object is bound to the
16801 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16802 image is specified, DATA is treated as a byte offset into the buffer
16803 object's data store.
16805 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
16806 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
16807 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
16808 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
16810 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16813 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16815 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16818 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16820 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16821 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16823 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
16824 , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
16825 `GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the border
16826 width of the texture image being modified. Note that W and H include
16827 twice the border width.
16829 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0.
16831 `GL_INVALID_OPERATION' is generated if the texture array has not been
16832 defined by a previous `glTexImage2D' operation.
16834 `GL_INVALID_OPERATION' is generated if TYPE is one of
16835 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16836 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16839 `GL_INVALID_OPERATION' is generated if TYPE is one of
16840 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16841 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16842 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16843 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16844 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16846 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16847 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16848 data store is currently mapped.
16850 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16851 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16852 unpacked from the buffer object such that the memory reads required
16853 would exceed the data store size.
16855 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16856 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16857 divisible into the number of bytes needed to store in memory a datum
16860 `GL_INVALID_OPERATION' is generated if `glTexSubImage2D' is executed
16861 between the execution of `glBegin' and the corresponding execution of
16864 (define-gl-procedures
16876 (data const-GLvoid-*)
16879 "Specify a three-dimensional texture subimage.
16882 Specifies the target texture. Must be `GL_TEXTURE_3D'.
16885 Specifies the level-of-detail number. Level 0 is the base image
16886 level. Level N is the Nth mipmap reduction image.
16889 Specifies a texel offset in the x direction within the texture
16893 Specifies a texel offset in the y direction within the texture
16897 Specifies a texel offset in the z direction within the texture
16901 Specifies the width of the texture subimage.
16904 Specifies the height of the texture subimage.
16907 Specifies the depth of the texture subimage.
16910 Specifies the format of the pixel data. The following symbolic
16911 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16912 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16913 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16916 Specifies the data type of the pixel data. The following symbolic
16917 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16918 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16919 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16920 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16921 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16922 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16923 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16924 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16927 Specifies a pointer to the image data in memory.
16929 Texturing maps a portion of a specified texture image onto each
16930 graphical primitive for which texturing is enabled. To enable and
16931 disable three-dimensional texturing, call `glEnable' and `glDisable'
16932 with argument `GL_TEXTURE_3D'.
16934 `glTexSubImage3D' redefines a contiguous subregion of an existing
16935 three-dimensional texture image. The texels referenced by DATA replace
16936 the portion of the existing texture array with x indices XOFFSET and
16937 XOFFSET+WIDTH-1 , inclusive, y indices YOFFSET and YOFFSET+HEIGHT-1 ,
16938 inclusive, and z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This
16939 region may not include any texels outside the range of the texture array
16940 as it was originally specified. It is not an error to specify a
16941 subtexture with zero width, height, or depth but such a specification
16944 If a non-zero named buffer object is bound to the
16945 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16946 image is specified, DATA is treated as a byte offset into the buffer
16947 object's data store.
16949 `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
16951 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16954 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16956 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16959 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16961 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16962 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16964 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
16965 , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , or ZOFFSET<-B , or
16966 (ZOFFSET+DEPTH,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
16967 `GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH' and B is the border
16968 width of the texture image being modified. Note that W , H , and D
16969 include twice the border width.
16971 `GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
16974 `GL_INVALID_OPERATION' is generated if the texture array has not been
16975 defined by a previous `glTexImage3D' operation.
16977 `GL_INVALID_OPERATION' is generated if TYPE is one of
16978 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16979 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16982 `GL_INVALID_OPERATION' is generated if TYPE is one of
16983 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16984 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16985 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16986 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16987 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16989 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16990 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16991 data store is currently mapped.
16993 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16994 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16995 unpacked from the buffer object such that the memory reads required
16996 would exceed the data store size.
16998 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16999 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
17000 divisible into the number of bytes needed to store in memory a datum
17003 `GL_INVALID_OPERATION' is generated if `glTexSubImage3D' is executed
17004 between the execution of `glBegin' and the corresponding execution of
17007 (define-gl-procedures
17014 "Multiply the current matrix by a translation matrix.
17021 Specify the X, Y, and Z coordinates of a translation vector.
17023 `glTranslate' produces a translation by (X,YZ) . The current matrix (see
17024 `glMatrixMode') is multiplied by this translation matrix, with the
17025 product replacing the current matrix, as if `glMultMatrix' were called
17026 with the following matrix for its argument:
17028 ((1 0 0 X), (0 1 0 Y), (0 0 1 Z), (0 0 0 1),)
17032 If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
17033 objects drawn after a call to `glTranslate' are translated.
17035 Use `glPushMatrix' and `glPopMatrix' to save and restore the
17036 untranslated coordinate system.
17038 `GL_INVALID_OPERATION' is generated if `glTranslate' is executed between
17039 the execution of `glBegin' and the corresponding execution of `glEnd'.")
17041 (define-gl-procedures
17068 (glUniform1i (location GLint) (v0 GLint) -> void)
17090 "Specify the value of a uniform variable for the current program object.
17093 Specifies the location of the uniform variable to be modified.
17096 Specifies the new values to be used for the specified uniform
17099 `glUniform' modifies the value of a uniform variable or a uniform
17100 variable array. The location of the uniform variable to be modified is
17101 specified by LOCATION, which should be a value returned by
17102 `glGetUniformLocation'. `glUniform' operates on the program object that
17103 was made part of current state by calling `glUseProgram'.
17105 The commands `glUniform{1|2|3|4}{f|i}' are used to change the value of
17106 the uniform variable specified by LOCATION using the values passed as
17107 arguments. The number specified in the command should match the number
17108 of components in the data type of the specified uniform variable (e.g.,
17109 `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The suffix
17110 `f' indicates that floating-point values are being passed; the suffix
17111 `i' indicates that integer values are being passed, and this type should
17112 also match the data type of the specified uniform variable. The `i'
17113 variants of this function should be used to provide values for uniform
17114 variables defined as int, ivec2, ivec3, ivec4, or arrays of these. The
17115 `f' variants should be used to provide values for uniform variables of
17116 type float, vec2, vec3, vec4, or arrays of these. Either the `i' or the
17117 `f' variants may be used to provide values for uniform variables of type
17118 bool, bvec2, bvec3, bvec4, or arrays of these. The uniform variable will
17119 be set to false if the input value is 0 or 0.0f, and it will be set to
17122 All active uniform variables defined in a program object are initialized
17123 to 0 when the program object is linked successfully. They retain the
17124 values assigned to them by a call to `glUniform ' until the next
17125 successful link operation occurs on the program object, when they are
17126 once again initialized to 0.
17128 The commands `glUniform{1|2|3|4}{f|i}v' can be used to modify a single
17129 uniform variable or a uniform variable array. These commands pass a
17130 count and a pointer to the values to be loaded into a uniform variable
17131 or a uniform variable array. A count of 1 should be used if modifying
17132 the value of a single uniform variable, and a count of 1 or greater can
17133 be used to modify an entire array or part of an array. When loading N
17134 elements starting at an arbitrary position M in a uniform variable
17135 array, elements M + N - 1 in the array will be replaced with the new
17136 values. If M + N - 1 is larger than the size of the uniform variable
17137 array, values for all array elements beyond the end of the array will be
17138 ignored. The number specified in the name of the command indicates the
17139 number of components for each element in VALUE, and it should match the
17140 number of components in the data type of the specified uniform variable
17141 (e.g., `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The
17142 data type specified in the name of the command must match the data type
17143 for the specified uniform variable as described previously for
17144 `glUniform{1|2|3|4}{f|i}'.
17146 For uniform variable arrays, each element of the array is considered to
17147 be of the type indicated in the name of the command (e.g., `glUniform3f'
17148 or `glUniform3fv' can be used to load a uniform variable array of type
17149 vec3). The number of elements of the uniform variable array to be
17150 modified is specified by COUNT
17152 The commands `glUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv' are used
17153 to modify a matrix or an array of matrices. The numbers in the command
17154 name are interpreted as the dimensionality of the matrix. The number `2'
17155 indicates a 2 × 2 matrix (i.e., 4 values), the number `3' indicates a 3
17156 × 3 matrix (i.e., 9 values), and the number `4' indicates a 4 × 4 matrix
17157 (i.e., 16 values). Non-square matrix dimensionality is explicit, with
17158 the first number representing the number of columns and the second
17159 number representing the number of rows. For example, `2x4' indicates a 2
17160 × 4 matrix with 2 columns and 4 rows (i.e., 8 values). If TRANSPOSE is
17161 `GL_FALSE', each matrix is assumed to be supplied in column major order.
17162 If TRANSPOSE is `GL_TRUE', each matrix is assumed to be supplied in row
17163 major order. The COUNT argument indicates the number of matrices to be
17164 passed. A count of 1 should be used if modifying the value of a single
17165 matrix, and a count greater than 1 can be used to modify an array of
17168 `GL_INVALID_OPERATION' is generated if there is no current program
17171 `GL_INVALID_OPERATION' is generated if the size of the uniform variable
17172 declared in the shader does not match the size indicated by the
17173 `glUniform' command.
17175 `GL_INVALID_OPERATION' is generated if one of the integer variants of
17176 this function is used to load a uniform variable of type float, vec2,
17177 vec3, vec4, or an array of these, or if one of the floating-point
17178 variants of this function is used to load a uniform variable of type
17179 int, ivec2, ivec3, or ivec4, or an array of these.
17181 `GL_INVALID_OPERATION' is generated if LOCATION is an invalid uniform
17182 location for the current program object and LOCATION is not equal to -1.
17184 `GL_INVALID_VALUE' is generated if COUNT is less than 0.
17186 `GL_INVALID_OPERATION' is generated if COUNT is greater than 1 and the
17187 indicated uniform variable is not an array variable.
17189 `GL_INVALID_OPERATION' is generated if a sampler is loaded using a
17190 command other than `glUniform1i' and `glUniform1iv'.
17192 `GL_INVALID_OPERATION' is generated if `glUniform' is executed between
17193 the execution of `glBegin' and the corresponding execution of `glEnd'.")
17195 (define-gl-procedures
17196 ((glUseProgram (program GLuint) -> void))
17197 "Installs a program object as part of current rendering state.
17200 Specifies the handle of the program object whose executables are to
17201 be used as part of current rendering state.
17203 `glUseProgram' installs the program object specified by PROGRAM as part
17204 of current rendering state. One or more executables are created in a
17205 program object by successfully attaching shader objects to it with
17206 `glAttachShader', successfully compiling the shader objects with
17207 `glCompileShader', and successfully linking the program object with
17210 A program object will contain an executable that will run on the vertex
17211 processor if it contains one or more shader objects of type
17212 `GL_VERTEX_SHADER' that have been successfully compiled and linked.
17213 Similarly, a program object will contain an executable that will run on
17214 the fragment processor if it contains one or more shader objects of type
17215 `GL_FRAGMENT_SHADER' that have been successfully compiled and linked.
17217 Successfully installing an executable on a programmable processor will
17218 cause the corresponding fixed functionality of OpenGL to be disabled.
17219 Specifically, if an executable is installed on the vertex processor, the
17220 OpenGL fixed functionality will be disabled as follows.
17222 * The projection matrix is not applied to vertex coordinates.
17224 * The texture matrices are not applied to texture coordinates.
17226 * Normals are not transformed to eye coordinates.
17228 * Normals are not rescaled or normalized.
17230 * Normalization of `GL_AUTO_NORMAL' evaluated normals is not
17233 * Texture coordinates are not generated automatically.
17235 * Per-vertex lighting is not performed.
17237 * Color material computations are not performed.
17239 * Color index lighting is not performed.
17241 * This list also applies when setting the current raster position.
17243 The executable that is installed on the vertex processor is expected to
17244 implement any or all of the desired functionality from the preceding
17245 list. Similarly, if an executable is installed on the fragment
17246 processor, the OpenGL fixed functionality will be disabled as follows.
17248 * Texture application is not applied.
17250 * Color sum is not applied.
17252 * Fog is not applied.
17254 Again, the fragment shader that is installed is expected to implement
17255 any or all of the desired functionality from the preceding list.
17257 While a program object is in use, applications are free to modify
17258 attached shader objects, compile attached shader objects, attach
17259 additional shader objects, and detach or delete shader objects. None of
17260 these operations will affect the executables that are part of the
17261 current state. However, relinking the program object that is currently
17262 in use will install the program object as part of the current rendering
17263 state if the link operation was successful (see `glLinkProgram' ). If
17264 the program object currently in use is relinked unsuccessfully, its link
17265 status will be set to `GL_FALSE', but the executables and associated
17266 state will remain part of the current state until a subsequent call to
17267 `glUseProgram' removes it from use. After it is removed from use, it
17268 cannot be made part of current state until it has been successfully
17271 If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but it
17272 does not contain shader objects of type `GL_FRAGMENT_SHADER', an
17273 executable will be installed on the vertex processor, but fixed
17274 functionality will be used for fragment processing. Similarly, if
17275 PROGRAM contains shader objects of type `GL_FRAGMENT_SHADER' but it does
17276 not contain shader objects of type `GL_VERTEX_SHADER', an executable
17277 will be installed on the fragment processor, but fixed functionality
17278 will be used for vertex processing. If PROGRAM is 0, the programmable
17279 processors will be disabled, and fixed functionality will be used for
17280 both vertex and fragment processing.
17282 `GL_INVALID_VALUE' is generated if PROGRAM is neither 0 nor a value
17283 generated by OpenGL.
17285 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
17287 `GL_INVALID_OPERATION' is generated if PROGRAM could not be made part of
17290 `GL_INVALID_OPERATION' is generated if `glUseProgram' is executed
17291 between the execution of `glBegin' and the corresponding execution of
17294 (define-gl-procedures
17295 ((glValidateProgram (program GLuint) -> void))
17296 "Validates a program object.
17299 Specifies the handle of the program object to be validated.
17301 `glValidateProgram' checks to see whether the executables contained in
17302 PROGRAM can execute given the current OpenGL state. The information
17303 generated by the validation process will be stored in PROGRAM's
17304 information log. The validation information may consist of an empty
17305 string, or it may be a string containing information about how the
17306 current program object interacts with the rest of current OpenGL state.
17307 This provides a way for OpenGL implementers to convey more information
17308 about why the current program is inefficient, suboptimal, failing to
17309 execute, and so on.
17311 The status of the validation operation will be stored as part of the
17312 program object's state. This value will be set to `GL_TRUE' if the
17313 validation succeeded, and `GL_FALSE' otherwise. It can be queried by
17314 calling `glGetProgram' with arguments PROGRAM and `GL_VALIDATE_STATUS'.
17315 If validation is successful, PROGRAM is guaranteed to execute given the
17316 current state. Otherwise, PROGRAM is guaranteed to not execute.
17318 This function is typically useful only during application development.
17319 The informational string stored in the information log is completely
17320 implementation dependent; therefore, an application should not expect
17321 different OpenGL implementations to produce identical information
17324 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
17327 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
17329 `GL_INVALID_OPERATION' is generated if `glValidateProgram' is executed
17330 between the execution of `glBegin' and the corresponding execution of
17333 (define-gl-procedures
17334 ((glVertexAttribPointer
17338 (normalized GLboolean)
17340 (pointer const-GLvoid-*)
17343 "Define an array of generic vertex attribute data.
17346 Specifies the index of the generic vertex attribute to be modified.
17349 Specifies the number of components per generic vertex attribute.
17350 Must be 1, 2, 3, or 4. The initial value is 4.
17353 Specifies the data type of each component in the array. Symbolic
17354 constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
17355 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
17356 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
17359 Specifies whether fixed-point data values should be normalized
17360 (`GL_TRUE') or converted directly as fixed-point values
17361 (`GL_FALSE') when they are accessed.
17364 Specifies the byte offset between consecutive generic vertex
17365 attributes. If STRIDE is 0, the generic vertex attributes are
17366 understood to be tightly packed in the array. The initial value is
17370 Specifies a pointer to the first component of the first generic
17371 vertex attribute in the array. The initial value is 0.
17373 `glVertexAttribPointer' specifies the location and data format of the
17374 array of generic vertex attributes at index INDEX to use when rendering.
17375 SIZE specifies the number of components per attribute and must be 1, 2,
17376 3, or 4. TYPE specifies the data type of each component, and STRIDE
17377 specifies the byte stride from one attribute to the next, allowing
17378 vertices and attributes to be packed into a single array or stored in
17379 separate arrays. If set to `GL_TRUE', NORMALIZED indicates that values
17380 stored in an integer format are to be mapped to the range [-1,1] (for
17381 signed values) or [0,1] (for unsigned values) when they are accessed and
17382 converted to floating point. Otherwise, values will be converted to
17383 floats directly without normalization.
17385 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
17386 target (see `glBindBuffer') while a generic vertex attribute array is
17387 specified, POINTER is treated as a byte offset into the buffer object's
17388 data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
17389 is saved as generic vertex attribute array client-side state
17390 (`GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING') for index INDEX.
17392 When a generic vertex attribute array is specified, SIZE, TYPE,
17393 NORMALIZED, STRIDE, and POINTER are saved as client-side state, in
17394 addition to the current vertex array buffer object binding.
17396 To enable and disable a generic vertex attribute array, call
17397 `glEnableVertexAttribArray' and `glDisableVertexAttribArray' with INDEX.
17398 If enabled, the generic vertex attribute array is used when
17399 `glArrayElement', `glDrawArrays', `glMultiDrawArrays', `glDrawElements',
17400 `glMultiDrawElements', or `glDrawRangeElements' is called.
17402 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
17403 `GL_MAX_VERTEX_ATTRIBS'.
17405 `GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
17407 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
17409 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
17411 (define-gl-procedures
17464 (glVertexAttrib4Nub
17472 "Specifies the value of a generic vertex attribute.
17475 Specifies the index of the generic vertex attribute to be modified.
17478 Specifies the new values to be used for the specified vertex
17481 OpenGL defines a number of standard vertex attributes that applications
17482 can modify with standard API entry points (color, normal, texture
17483 coordinates, etc.). The `glVertexAttrib' family of entry points allows
17484 an application to pass generic vertex attributes in numbered locations.
17486 Generic attributes are defined as four-component values that are
17487 organized into an array. The first entry of this array is numbered 0,
17488 and the size of the array is specified by the implementation-dependent
17489 constant `GL_MAX_VERTEX_ATTRIBS'. Individual elements of this array can
17490 be modified with a `glVertexAttrib' call that specifies the index of the
17491 element to be modified and a value for that element.
17493 These commands can be used to specify one, two, three, or all four
17494 components of the generic vertex attribute specified by INDEX. A `1' in
17495 the name of the command indicates that only one value is passed, and it
17496 will be used to modify the first component of the generic vertex
17497 attribute. The second and third components will be set to 0, and the
17498 fourth component will be set to 1. Similarly, a `2' in the name of the
17499 command indicates that values are provided for the first two components,
17500 the third component will be set to 0, and the fourth component will be
17501 set to 1. A `3' in the name of the command indicates that values are
17502 provided for the first three components and the fourth component will be
17503 set to 1, whereas a `4' in the name indicates that values are provided
17504 for all four components.
17506 The letters `s', `f', `i', `d', `ub', `us', and `ui' indicate whether
17507 the arguments are of type short, float, int, double, unsigned byte,
17508 unsigned short, or unsigned int. When `v' is appended to the name, the
17509 commands can take a pointer to an array of such values. The commands
17510 containing `N' indicate that the arguments will be passed as fixed-point
17511 values that are scaled to a normalized range according to the component
17512 conversion rules defined by the OpenGL specification. Signed values are
17513 understood to represent fixed-point values in the range [-1,1], and
17514 unsigned values are understood to represent fixed-point values in the
17517 OpenGL Shading Language attribute variables are allowed to be of type
17518 mat2, mat3, or mat4. Attributes of these types may be loaded using the
17519 `glVertexAttrib' entry points. Matrices must be loaded into successive
17520 generic attribute slots in column major order, with one column of the
17521 matrix in each generic attribute slot.
17523 A user-defined attribute variable declared in a vertex shader can be
17524 bound to a generic attribute index by calling `glBindAttribLocation'.
17525 This allows an application to use more descriptive variable names in a
17526 vertex shader. A subsequent change to the specified generic vertex
17527 attribute will be immediately reflected as a change to the corresponding
17528 attribute variable in the vertex shader.
17530 The binding between a generic vertex attribute index and a user-defined
17531 attribute variable in a vertex shader is part of the state of a program
17532 object, but the current value of the generic vertex attribute is not.
17533 The value of each generic vertex attribute is part of current state,
17534 just like standard vertex attributes, and it is maintained even if a
17535 different program object is used.
17537 An application may freely modify generic vertex attributes that are not
17538 bound to a named vertex shader attribute variable. These values are
17539 simply maintained as part of current state and will not be accessed by
17540 the vertex shader. If a generic vertex attribute bound to an attribute
17541 variable in a vertex shader is not updated while the vertex shader is
17542 executing, the vertex shader will repeatedly use the current value for
17543 the generic vertex attribute.
17545 The generic vertex attribute with index 0 is the same as the vertex
17546 position attribute previously defined by OpenGL. A `glVertex2',
17547 `glVertex3', or `glVertex4' command is completely equivalent to the
17548 corresponding `glVertexAttrib' command with an index argument of 0. A
17549 vertex shader can access generic vertex attribute 0 by using the
17550 built-in attribute variable GL_VERTEX. There are no current values for
17551 generic vertex attribute 0. This is the only generic vertex attribute
17552 with this property; calls to set other standard vertex attributes can be
17553 freely mixed with calls to set any of the other generic vertex
17556 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
17557 `GL_MAX_VERTEX_ATTRIBS'.")
17559 (define-gl-procedures
17564 (pointer const-GLvoid-*)
17567 "Define an array of vertex data.
17570 Specifies the number of coordinates per vertex. Must be 2, 3, or 4.
17571 The initial value is 4.
17574 Specifies the data type of each coordinate in the array. Symbolic
17575 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
17576 accepted. The initial value is `GL_FLOAT'.
17579 Specifies the byte offset between consecutive vertices. If STRIDE
17580 is 0, the vertices are understood to be tightly packed in the
17581 array. The initial value is 0.
17584 Specifies a pointer to the first coordinate of the first vertex in
17585 the array. The initial value is 0.
17587 `glVertexPointer' specifies the location and data format of an array of
17588 vertex coordinates to use when rendering. SIZE specifies the number of
17589 coordinates per vertex, and must be 2, 3, or 4. TYPE specifies the data
17590 type of each coordinate, and STRIDE specifies the byte stride from one
17591 vertex to the next, allowing vertices and attributes to be packed into a
17592 single array or stored in separate arrays. (Single-array storage may be
17593 more efficient on some implementations; see `glInterleavedArrays'.)
17595 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
17596 target (see `glBindBuffer') while a vertex array is specified, POINTER
17597 is treated as a byte offset into the buffer object's data store. Also,
17598 the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as vertex
17599 array client-side state (`GL_VERTEX_ARRAY_BUFFER_BINDING').
17601 When a vertex array is specified, SIZE, TYPE, STRIDE, and POINTER are
17602 saved as client-side state, in addition to the current vertex array
17603 buffer object binding.
17605 To enable and disable the vertex array, call `glEnableClientState' and
17606 `glDisableClientState' with the argument `GL_VERTEX_ARRAY'. If enabled,
17607 the vertex array is used when `glArrayElement', `glDrawArrays',
17608 `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements', or
17609 `glDrawRangeElements' is called.
17611 `GL_INVALID_VALUE' is generated if SIZE is not 2, 3, or 4.
17613 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
17615 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
17617 (define-gl-procedures
17618 ((glVertex2i (x GLint) (y GLint) -> void)
17619 (glVertex2f (x GLfloat) (y GLfloat) -> void)
17655 Specify X, Y, Z, and W coordinates of a vertex. Not all parameters
17656 are present in all forms of the command.
17658 `glVertex' commands are used within `glBegin'/`glEnd' pairs to specify
17659 point, line, and polygon vertices. The current color, normal, texture
17660 coordinates, and fog coordinate are associated with the vertex when
17661 `glVertex' is called.
17663 When only X and Y are specified, Z defaults to 0 and W defaults to 1.
17664 When X , Y , and Z are specified, W defaults to 1.")
17666 (define-gl-procedures
17679 Specify the lower left corner of the viewport rectangle, in pixels.
17680 The initial value is (0,0).
17685 Specify the width and height of the viewport. When a GL context is
17686 first attached to a window, WIDTH and HEIGHT are set to the
17687 dimensions of that window.
17689 `glViewport' specifies the affine transformation of X and Y from
17690 normalized device coordinates to window coordinates. Let (X_ND,Y_ND) be
17691 normalized device coordinates. Then the window coordinates (X_W,Y_W) are
17692 computed as follows:
17694 X_W=(X_ND+1,)\u2062(WIDTH/2,)+X
17696 Y_W=(Y_ND+1,)\u2062(HEIGHT/2,)+Y
17698 Viewport width and height are silently clamped to a range that depends
17699 on the implementation. To query this range, call `glGet' with argument
17700 `GL_MAX_VIEWPORT_DIMS'.
17702 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
17704 `GL_INVALID_OPERATION' is generated if `glViewport' is executed between
17705 the execution of `glBegin' and the corresponding execution of `glEnd'.")
17707 (define-gl-procedures
17708 ((glWindowPos2i (x GLint) (y GLint) -> void)
17709 (glWindowPos2f (x GLfloat) (y GLfloat) -> void)
17722 "Specify the raster position in window coordinates for pixel operations.
17729 Specify the X , Y , Z coordinates for the raster position.
17731 The GL maintains a 3D position in window coordinates. This position,
17732 called the raster position, is used to position pixel and bitmap write
17733 operations. It is maintained with subpixel accuracy. See `glBitmap',
17734 `glDrawPixels', and `glCopyPixels'.
17736 `glWindowPos2' specifies the X and Y coordinates, while Z is implicitly
17737 set to 0. `glWindowPos3' specifies all three coordinates. The W
17738 coordinate of the current raster position is always set to 1.0.
17740 `glWindowPos' directly updates the X and Y coordinates of the current
17741 raster position with the values specified. That is, the values are
17742 neither transformed by the current modelview and projection matrices,
17743 nor by the viewport-to-window transform. The Z coordinate of the current
17744 raster position is updated in the following manner:
17746 Z={(N), (F), (N+Z×(F-N,),)\u2062(IF\u2062Z<=0), (IF\u2062Z>=1), (`otherwise',),
17750 where N is `GL_DEPTH_RANGE''s near value, and F is `GL_DEPTH_RANGE''s
17751 far value. See `glDepthRange'.
17753 The specified coordinates are not clip-tested, causing the raster
17754 position to always be valid.
17756 The current raster position also includes some associated color data and
17757 texture coordinates. If lighting is enabled, then
17758 `GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
17759 (in color index mode) is set to the color produced by the lighting
17760 calculation (see `glLight', `glLightModel', and `glShadeModel'). If
17761 lighting is disabled, current color (in RGBA mode, state variable
17762 `GL_CURRENT_COLOR') or color index (in color index mode, state variable
17763 `GL_CURRENT_INDEX') is used to update the current raster color.
17764 `GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
17766 Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
17767 `GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
17768 generation functions (see `glTexGen'). The `GL_CURRENT_RASTER_DISTANCE'
17769 is set to the `GL_CURRENT_FOG_COORD'.
17773 `GL_INVALID_OPERATION' is generated if `glWindowPos' is executed between
17774 the execution of `glBegin' and the corresponding execution of `glEnd'.")