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.
46 (figl low-level support)
63 glBlendEquationSeparate
91 glCompressedTexImage1D
92 glCompressedTexImage2D
93 glCompressedTexImage3D
94 glCompressedTexSubImage1D
95 glCompressedTexSubImage2D
96 glCompressedTexSubImage3D
99 glConvolutionParameterf
100 glConvolutionParameteri
103 glCopyConvolutionFilter1D
104 glCopyConvolutionFilter2D
134 glEnableVertexAttribArray
135 glDisableVertexAttribArray
164 glGetCompressedTexImage
165 glGetConvolutionFilter
204 glLoadTransposeMatrixd
227 glMultTransposeMatrixd
272 glSecondaryColorPointer
280 glStencilFuncSeparate
282 glStencilMaskSeparate
318 glVertexAttribPointer
342 ((glAccum (op GLenum) (value GLfloat) -> void))
343 "Operate on the accumulation buffer.
346 Specifies the accumulation buffer operation. Symbolic constants
347 `GL_ACCUM', `GL_LOAD', `GL_ADD', `GL_MULT', and `GL_RETURN' are
351 Specifies a floating-point value used in the accumulation buffer
352 operation. OP determines how VALUE is used.
354 The accumulation buffer is an extended-range color buffer. Images are
355 not rendered into it. Rather, images rendered into one of the color
356 buffers are added to the contents of the accumulation buffer after
357 rendering. Effects such as antialiasing (of points, lines, and
358 polygons), motion blur, and depth of field can be created by
359 accumulating images generated with different transformation matrices.
361 Each pixel in the accumulation buffer consists of red, green, blue, and
362 alpha values. The number of bits per component in the accumulation
363 buffer depends on the implementation. You can examine this number by
364 calling `glGetIntegerv' four times, with arguments `GL_ACCUM_RED_BITS',
365 `GL_ACCUM_GREEN_BITS', `GL_ACCUM_BLUE_BITS', and `GL_ACCUM_ALPHA_BITS'.
366 Regardless of the number of bits per component, the range of values
367 stored by each component is [-1,1] . The accumulation buffer pixels are
368 mapped one-to-one with frame buffer pixels.
370 `glAccum' operates on the accumulation buffer. The first argument, OP,
371 is a symbolic constant that selects an accumulation buffer operation.
372 The second argument, VALUE, is a floating-point value to be used in that
373 operation. Five operations are specified: `GL_ACCUM', `GL_LOAD',
374 `GL_ADD', `GL_MULT', and `GL_RETURN'.
376 All accumulation buffer operations are limited to the area of the
377 current scissor box and applied identically to the red, green, blue, and
378 alpha components of each pixel. If a `glAccum' operation results in a
379 value outside the range [-1,1] , the contents of an accumulation buffer
380 pixel component are undefined.
382 The operations are as follows:
385 Obtains R, G, B, and A values from the buffer currently selected
386 for reading (see `glReadBuffer'). Each component value is divided
387 by 2^N-1 , where N is the number of bits allocated to each color
388 component in the currently selected buffer. The result is a
389 floating-point value in the range [0,1] , which is multiplied by
390 VALUE and added to the corresponding pixel component in the
391 accumulation buffer, thereby updating the accumulation buffer.
394 Similar to `GL_ACCUM', except that the current value in the
395 accumulation buffer is not used in the calculation of the new
396 value. That is, the R, G, B, and A values from the currently
397 selected buffer are divided by 2^N-1 , multiplied by VALUE, and
398 then stored in the corresponding accumulation buffer cell,
399 overwriting the current value.
402 Adds VALUE to each R, G, B, and A in the accumulation buffer.
405 Multiplies each R, G, B, and A in the accumulation buffer by VALUE
406 and returns the scaled component to its corresponding accumulation
410 Transfers accumulation buffer values to the color buffer or buffers
411 currently selected for writing. Each R, G, B, and A component is
412 multiplied by VALUE, then multiplied by 2^N-1 , clamped to the
413 range [0,2^N-1] , and stored in the corresponding display buffer
414 cell. The only fragment operations that are applied to this
415 transfer are pixel ownership, scissor, dithering, and color
418 To clear the accumulation buffer, call `glClearAccum' with R, G, B, and
419 A values to set it to, then call `glClear' with the accumulation buffer
422 `GL_INVALID_ENUM' is generated if OP is not an accepted value.
424 `GL_INVALID_OPERATION' is generated if there is no accumulation buffer.
426 `GL_INVALID_OPERATION' is generated if `glAccum' is executed between the
427 execution of `glBegin' and the corresponding execution of `glEnd'.")
430 ((glActiveTexture (texture GLenum) -> void))
431 "Select active texture unit.
434 Specifies which texture unit to make active. The number of texture
435 units is implementation dependent, but must be at least two.
436 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
437 the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
438 (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1). The initial value is
441 `glActiveTexture' selects which texture unit subsequent texture state
442 calls will affect. The number of texture units an implementation
443 supports is implementation dependent, but must be at least 2.
445 Vertex arrays are client-side GL resources, which are selected by the
446 `glClientActiveTexture' routine.
448 `GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
449 where i ranges from 0 to the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
450 (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1).")
458 "Specify the alpha test function.
461 Specifies the alpha comparison function. Symbolic constants
462 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
463 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
464 initial value is `GL_ALWAYS'.
467 Specifies the reference value that incoming alpha values are
468 compared to. This value is clamped to the range [0,1] , where 0
469 represents the lowest possible alpha value and 1 the highest
470 possible value. The initial reference value is 0.
472 The alpha test discards fragments depending on the outcome of a
473 comparison between an incoming fragment's alpha value and a constant
474 reference value. `glAlphaFunc' specifies the reference value and the
475 comparison function. The comparison is performed only if alpha testing
476 is enabled. By default, it is not enabled. (See `glEnable' and
477 `glDisable' of `GL_ALPHA_TEST'.)
479 FUNC and REF specify the conditions under which the pixel is drawn. The
480 incoming alpha value is compared to REF using the function specified by
481 FUNC. If the value passes the comparison, the incoming fragment is drawn
482 if it also passes subsequent stencil and depth buffer tests. If the
483 value fails the comparison, no change is made to the frame buffer at
484 that pixel location. The comparison functions are as follows:
490 Passes if the incoming alpha value is less than the reference
494 Passes if the incoming alpha value is equal to the reference value.
497 Passes if the incoming alpha value is less than or equal to the
501 Passes if the incoming alpha value is greater than the reference
505 Passes if the incoming alpha value is not equal to the reference
509 Passes if the incoming alpha value is greater than or equal to the
513 Always passes (initial value).
515 `glAlphaFunc' operates on all pixel write operations, including those
516 resulting from the scan conversion of points, lines, polygons, and
517 bitmaps, and from pixel draw and copy operations. `glAlphaFunc' does not
518 affect screen clear operations.
520 `GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
522 `GL_INVALID_OPERATION' is generated if `glAlphaFunc' is executed between
523 the execution of `glBegin' and the corresponding execution of `glEnd'.")
526 ((glAreTexturesResident
532 "Determine if textures are loaded in texture memory.
535 Specifies the number of textures to be queried.
538 Specifies an array containing the names of the textures to be
542 Specifies an array in which the texture residence status is
543 returned. The residence status of a texture named by an element of
544 TEXTURES is returned in the corresponding element of RESIDENCES.
546 GL establishes a ``working set'' of textures that are resident in
547 texture memory. These textures can be bound to a texture target much
548 more efficiently than textures that are not resident.
550 `glAreTexturesResident' queries the texture residence status of the N
551 textures named by the elements of TEXTURES. If all the named textures
552 are resident, `glAreTexturesResident' returns `GL_TRUE', and the
553 contents of RESIDENCES are undisturbed. If not all the named textures
554 are resident, `glAreTexturesResident' returns `GL_FALSE', and detailed
555 status is returned in the N elements of RESIDENCES. If an element of
556 RESIDENCES is `GL_TRUE', then the texture named by the corresponding
557 element of TEXTURES is resident.
559 The residence status of a single bound texture may also be queried by
560 calling `glGetTexParameter' with the TARGET argument set to the target
561 to which the texture is bound, and the PNAME argument set to
562 `GL_TEXTURE_RESIDENT'. This is the only way that the residence status of
563 a default texture can be queried.
565 `GL_INVALID_VALUE' is generated if N is negative.
567 `GL_INVALID_VALUE' is generated if any element in TEXTURES is 0 or does
568 not name a texture. In that case, the function returns `GL_FALSE' and
569 the contents of RESIDENCES is indeterminate.
571 `GL_INVALID_OPERATION' is generated if `glAreTexturesResident' is
572 executed between the execution of `glBegin' and the corresponding
573 execution of `glEnd'.")
576 ((glArrayElement (i GLint) -> void))
577 "Render a vertex using the specified vertex array element.
580 Specifies an index into the enabled vertex data arrays.
582 `glArrayElement' commands are used within `glBegin'/`glEnd' pairs to
583 specify vertex and attribute data for point, line, and polygon
584 primitives. If `GL_VERTEX_ARRAY' is enabled when `glArrayElement' is
585 called, a single vertex is drawn, using vertex and attribute data taken
586 from location I of the enabled arrays. If `GL_VERTEX_ARRAY' is not
587 enabled, no drawing occurs but the attributes corresponding to the
588 enabled arrays are modified.
590 Use `glArrayElement' to construct primitives by indexing vertex data,
591 rather than by streaming through arrays of data in first-to-last order.
592 Because each call specifies only a single vertex, it is possible to
593 explicitly specify per-primitive attributes such as a single normal for
596 Changes made to array data between the execution of `glBegin' and the
597 corresponding execution of `glEnd' may affect calls to `glArrayElement'
598 that are made within the same `glBegin'/`glEnd' period in nonsequential
599 ways. That is, a call to `glArrayElement' that precedes a change to
600 array data may access the changed data, and a call that follows a change
601 to array data may access original data.
603 `GL_INVALID_VALUE' may be generated if I is negative.
605 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
606 bound to an enabled array and the buffer object's data store is
615 "Attaches a shader object to a program object.
618 Specifies the program object to which a shader object will be
622 Specifies the shader object that is to be attached.
624 In order to create an executable, there must be a way to specify the
625 list of things that will be linked together. Program objects provide
626 this mechanism. Shaders that are to be linked together in a program
627 object must first be attached to that program object. `glAttachShader'
628 attaches the shader object specified by SHADER to the program object
629 specified by PROGRAM. This indicates that SHADER will be included in
630 link operations that will be performed on PROGRAM.
632 All operations that can be performed on a shader object are valid
633 whether or not the shader object is attached to a program object. It is
634 permissible to attach a shader object to a program object before source
635 code has been loaded into the shader object or before the shader object
636 has been compiled. It is permissible to attach multiple shader objects
637 of the same type because each may contain a portion of the complete
638 shader. It is also permissible to attach a shader object to more than
639 one program object. If a shader object is deleted while it is attached
640 to a program object, it will be flagged for deletion, and deletion will
641 not occur until `glDetachShader' is called to detach it from all program
642 objects to which it is attached.
644 `GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is not a
645 value generated by OpenGL.
647 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
649 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
651 `GL_INVALID_OPERATION' is generated if SHADER is already attached to
654 `GL_INVALID_OPERATION' is generated if `glAttachShader' is executed
655 between the execution of `glBegin' and the corresponding execution of
664 (glEndQuery (target GLenum) -> void))
665 "Delimit the boundaries of a query object.
668 Specifies the target type of query object established between
669 `glBeginQuery' and the subsequent `glEndQuery'. The symbolic
670 constant must be `GL_SAMPLES_PASSED'.
673 Specifies the name of a query object.
675 `glBeginQuery' and `glEndQuery' delimit the boundaries of a query
676 object. If a query object with name ID does not yet exist it is created.
678 When `glBeginQuery' is executed, the query object's samples-passed
679 counter is reset to 0. Subsequent rendering will increment the counter
680 once for every sample that passes the depth test. When `glEndQuery' is
681 executed, the samples-passed counter is assigned to the query object's
682 result value. This value can be queried by calling `glGetQueryObject'
683 with PNAME`GL_QUERY_RESULT'.
685 Querying the `GL_QUERY_RESULT' implicitly flushes the GL pipeline until
686 the rendering delimited by the query object has completed and the result
687 is available. `GL_QUERY_RESULT_AVAILABLE' can be queried to determine if
688 the result is immediately available or if the rendering is not yet
691 `GL_INVALID_ENUM' is generated if TARGET is not `GL_SAMPLES_PASSED'.
693 `GL_INVALID_OPERATION' is generated if `glBeginQuery' is executed while
694 a query object of the same TARGET is already active.
696 `GL_INVALID_OPERATION' is generated if `glEndQuery' is executed when a
697 query object of the same TARGET is not active.
699 `GL_INVALID_OPERATION' is generated if ID is 0.
701 `GL_INVALID_OPERATION' is generated if ID is the name of an already
704 `GL_INVALID_OPERATION' is generated if `glBeginQuery' or `glEndQuery' is
705 executed between the execution of `glBegin' and the corresponding
706 execution of `glEnd'.")
709 ((glBegin (mode GLenum) -> void) (glEnd -> void))
710 "Delimit the vertices of a primitive or a group of like primitives.
713 Specifies the primitive or primitives that will be created from
714 vertices presented between `glBegin' and the subsequent `glEnd'.
715 Ten symbolic constants are accepted: `GL_POINTS', `GL_LINES',
716 `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_TRIANGLES',
717 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_QUADS',
718 `GL_QUAD_STRIP', and `GL_POLYGON'.
720 `glBegin' and `glEnd' delimit the vertices that define a primitive or a
721 group of like primitives. `glBegin' accepts a single argument that
722 specifies in which of ten ways the vertices are interpreted. Taking N as
723 an integer count starting at one, and N as the total number of vertices
724 specified, the interpretations are as follows:
727 Treats each vertex as a single point. Vertex N defines point N . N
731 Treats each pair of vertices as an independent line segment.
732 Vertices 2\u2062N-1 and 2\u2062N define line N . N/2 lines are drawn.
735 Draws a connected group of line segments from the first vertex to
736 the last. Vertices N and N+1 define line N . N-1 lines are drawn.
739 Draws a connected group of line segments from the first vertex to
740 the last, then back to the first. Vertices N and N+1 define line N
741 . The last line, however, is defined by vertices N and 1 . N lines
745 Treats each triplet of vertices as an independent triangle.
746 Vertices 3\u2062N-2 , 3\u2062N-1 , and 3\u2062N define triangle N . N/3 triangles
750 Draws a connected group of triangles. One triangle is defined for
751 each vertex presented after the first two vertices. For odd N ,
752 vertices N , N+1 , and N+2 define triangle N . For even N ,
753 vertices N+1 , N , and N+2 define triangle N . N-2 triangles are
757 Draws a connected group of triangles. One triangle is defined for
758 each vertex presented after the first two vertices. Vertices 1 ,
759 N+1 , and N+2 define triangle N . N-2 triangles are drawn.
762 Treats each group of four vertices as an independent quadrilateral.
763 Vertices 4\u2062N-3 , 4\u2062N-2 , 4\u2062N-1 , and 4\u2062N define quadrilateral N .
764 N/4 quadrilaterals are drawn.
767 Draws a connected group of quadrilaterals. One quadrilateral is
768 defined for each pair of vertices presented after the first pair.
769 Vertices 2\u2062N-1 , 2\u2062N , 2\u2062N+2 , and 2\u2062N+1 define quadrilateral N .
770 N/2-1 quadrilaterals are drawn. Note that the order in which
771 vertices are used to construct a quadrilateral from strip data is
772 different from that used with independent data.
775 Draws a single, convex polygon. Vertices 1 through N define this
778 Only a subset of GL commands can be used between `glBegin' and `glEnd'.
779 The commands are `glVertex', `glColor', `glSecondaryColor', `glIndex',
780 `glNormal', `glFogCoord', `glTexCoord', `glMultiTexCoord',
781 `glVertexAttrib', `glEvalCoord', `glEvalPoint', `glArrayElement',
782 `glMaterial', and `glEdgeFlag'. Also, it is acceptable to use
783 `glCallList' or `glCallLists' to execute display lists that include only
784 the preceding commands. If any other GL command is executed between
785 `glBegin' and `glEnd', the error flag is set and the command is ignored.
787 Regardless of the value chosen for MODE, there is no limit to the number
788 of vertices that can be defined between `glBegin' and `glEnd'. Lines,
789 triangles, quadrilaterals, and polygons that are incompletely specified
790 are not drawn. Incomplete specification results when either too few
791 vertices are provided to specify even a single primitive or when an
792 incorrect multiple of vertices is specified. The incomplete primitive is
793 ignored; the rest are drawn.
795 The minimum specification of vertices for each primitive is as follows:
796 1 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral,
797 and 3 for a polygon. Modes that require a certain multiple of vertices
798 are `GL_LINES' (2), `GL_TRIANGLES' (3), `GL_QUADS' (4), and
801 `GL_INVALID_ENUM' is generated if MODE is set to an unaccepted value.
803 `GL_INVALID_OPERATION' is generated if `glBegin' is executed between a
804 `glBegin' and the corresponding execution of `glEnd'.
806 `GL_INVALID_OPERATION' is generated if `glEnd' is executed without being
807 preceded by a `glBegin'.
809 `GL_INVALID_OPERATION' is generated if a command other than `glVertex',
810 `glColor', `glSecondaryColor', `glIndex', `glNormal', `glFogCoord',
811 `glTexCoord', `glMultiTexCoord', `glVertexAttrib', `glEvalCoord',
812 `glEvalPoint', `glArrayElement', `glMaterial', `glEdgeFlag',
813 `glCallList', or `glCallLists' is executed between the execution of
814 `glBegin' and the corresponding execution `glEnd'.
816 Execution of `glEnableClientState', `glDisableClientState',
817 `glEdgeFlagPointer', `glFogCoordPointer', `glTexCoordPointer',
818 `glColorPointer', `glSecondaryColorPointer', `glIndexPointer',
819 `glNormalPointer', `glVertexPointer', `glVertexAttribPointer',
820 `glInterleavedArrays', or `glPixelStore' is not allowed after a call to
821 `glBegin' and before the corresponding call to `glEnd', but an error may
822 or may not be generated.")
825 ((glBindAttribLocation
831 "Associates a generic vertex attribute index with a named attribute
835 Specifies the handle of the program object in which the association
839 Specifies the index of the generic vertex attribute to be bound.
842 Specifies a null terminated string containing the name of the
843 vertex shader attribute variable to which INDEX is to be bound.
845 `glBindAttribLocation' is used to associate a user-defined attribute
846 variable in the program object specified by PROGRAM with a generic
847 vertex attribute index. The name of the user-defined attribute variable
848 is passed as a null terminated string in NAME. The generic vertex
849 attribute index to be bound to this variable is specified by INDEX. When
850 PROGRAM is made part of current state, values provided via the generic
851 vertex attribute INDEX will modify the value of the user-defined
852 attribute variable specified by NAME.
854 If NAME refers to a matrix attribute variable, INDEX refers to the first
855 column of the matrix. Other matrix columns are then automatically bound
856 to locations INDEX+1 for a matrix of type mat2; INDEX+1 and INDEX+2 for
857 a matrix of type mat3; and INDEX+1, INDEX+2, and INDEX+3 for a matrix of
860 This command makes it possible for vertex shaders to use descriptive
861 names for attribute variables rather than generic variables that are
862 numbered from 0 to `GL_MAX_VERTEX_ATTRIBS' -1. The values sent to each
863 generic attribute index are part of current state, just like standard
864 vertex attributes such as color, normal, and vertex position. If a
865 different program object is made current by calling `glUseProgram', the
866 generic vertex attributes are tracked in such a way that the same values
867 will be observed by attributes in the new program object that are also
870 Attribute variable name-to-generic attribute index bindings for a
871 program object can be explicitly assigned at any time by calling
872 `glBindAttribLocation'. Attribute bindings do not go into effect until
873 `glLinkProgram' is called. After a program object has been linked
874 successfully, the index values for generic attributes remain fixed (and
875 their values can be queried) until the next link command occurs.
877 Applications are not allowed to bind any of the standard OpenGL vertex
878 attributes using this command, as they are bound automatically when
879 needed. Any attribute binding that occurs after the program object has
880 been linked will not take effect until the next time the program object
883 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
884 `GL_MAX_VERTEX_ATTRIBS'.
886 `GL_INVALID_OPERATION' is generated if NAME starts with the reserved
889 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
892 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
894 `GL_INVALID_OPERATION' is generated if `glBindAttribLocation' is
895 executed between the execution of `glBegin' and the corresponding
896 execution of `glEnd'.")
904 "Bind a named buffer object.
907 Specifies the target to which the buffer object is bound. The
908 symbolic constant must be `GL_ARRAY_BUFFER',
909 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
910 `GL_PIXEL_UNPACK_BUFFER'.
913 Specifies the name of a buffer object.
915 `glBindBuffer' lets you create or use a named buffer object. Calling
916 `glBindBuffer' with TARGET set to `GL_ARRAY_BUFFER',
917 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER' or
918 `GL_PIXEL_UNPACK_BUFFER' and BUFFER set to the name of the new buffer
919 object binds the buffer object name to the target. When a buffer object
920 is bound to a target, the previous binding for that target is
921 automatically broken.
923 Buffer object names are unsigned integers. The value zero is reserved,
924 but there is no default buffer object for each buffer object target.
925 Instead, BUFFER set to zero effectively unbinds any buffer object
926 previously bound, and restores client memory usage for that buffer
927 object target. Buffer object names and the corresponding buffer object
928 contents are local to the shared display-list space (see
929 `glXCreateContext') of the current GL rendering context; two rendering
930 contexts share buffer object names only if they also share display
933 You may use `glGenBuffers' to generate a set of new buffer object names.
935 The state of a buffer object immediately after it is first bound is an
936 unmapped zero-sized memory buffer with `GL_READ_WRITE' access and
937 `GL_STATIC_DRAW' usage.
939 While a non-zero buffer object name is bound, GL operations on the
940 target to which it is bound affect the bound buffer object, and queries
941 of the target to which it is bound return state from the bound buffer
942 object. While buffer object name zero is bound, as in the initial state,
943 attempts to modify or query state on the target to which it is bound
944 generates an `GL_INVALID_OPERATION' error.
946 When vertex array pointer state is changed, for example by a call to
947 `glNormalPointer', the current buffer object binding
948 (`GL_ARRAY_BUFFER_BINDING') is copied into the corresponding client
949 state for the vertex array type being changed, for example
950 `GL_NORMAL_ARRAY_BUFFER_BINDING'. While a non-zero buffer object is
951 bound to the `GL_ARRAY_BUFFER' target, the vertex array pointer
952 parameter that is traditionally interpreted as a pointer to client-side
953 memory is instead interpreted as an offset within the buffer object
954 measured in basic machine units.
956 While a non-zero buffer object is bound to the `GL_ELEMENT_ARRAY_BUFFER'
957 target, the indices parameter of `glDrawElements',
958 `glDrawRangeElements', or `glMultiDrawElements' that is traditionally
959 interpreted as a pointer to client-side memory is instead interpreted as
960 an offset within the buffer object measured in basic machine units.
962 While a non-zero buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
963 target, the following commands are affected: `glGetCompressedTexImage',
964 `glGetConvolutionFilter', `glGetHistogram', `glGetMinmax',
965 `glGetPixelMap', `glGetPolygonStipple', `glGetSeparableFilter',
966 `glGetTexImage', and `glReadPixels'. The pointer parameter that is
967 traditionally interpreted as a pointer to client-side memory where the
968 pixels are to be packed is instead interpreted as an offset within the
969 buffer object measured in basic machine units.
971 While a non-zero buffer object is bound to the `GL_PIXEL_UNPACK_BUFFER'
972 target, the following commands are affected: `glBitmap',
973 `glColorSubTable', `glColorTable', `glCompressedTexImage1D',
974 `glCompressedTexImage2D', `glCompressedTexImage3D',
975 `glCompressedTexSubImage1D', `glCompressedTexSubImage2D',
976 `glCompressedTexSubImage3D', `glConvolutionFilter1D',
977 `glConvolutionFilter2D', `glDrawPixels', `glPixelMap',
978 `glPolygonStipple', `glSeparableFilter2D', `glTexImage1D',
979 `glTexImage2D', `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
980 and `glTexSubImage3D'. The pointer parameter that is traditionally
981 interpreted as a pointer to client-side memory from which the pixels are
982 to be unpacked is instead interpreted as an offset within the buffer
983 object measured in basic machine units.
985 A buffer object binding created with `glBindBuffer' remains active until
986 a different buffer object name is bound to the same target, or until the
987 bound buffer object is deleted with `glDeleteBuffers'.
989 Once created, a named buffer object may be re-bound to any target as
990 often as needed. However, the GL implementation may make choices about
991 how to optimize the storage of a buffer object based on its initial
994 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
997 `GL_INVALID_OPERATION' is generated if `glBindBuffer' is executed
998 between the execution of `glBegin' and the corresponding execution of
1001 (define-gl-procedure
1007 "Bind a named texture to a texturing target.
1010 Specifies the target to which the texture is bound. Must be either
1011 `GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D', or
1012 `GL_TEXTURE_CUBE_MAP'.
1015 Specifies the name of a texture.
1017 `glBindTexture' lets you create or use a named texture. Calling
1018 `glBindTexture' with TARGET set to `GL_TEXTURE_1D', `GL_TEXTURE_2D',
1019 `GL_TEXTURE_3D' or `GL_TEXTURE_CUBE_MAP' and TEXTURE set to the name of
1020 the new texture binds the texture name to the target. When a texture is
1021 bound to a target, the previous binding for that target is automatically
1024 Texture names are unsigned integers. The value zero is reserved to
1025 represent the default texture for each texture target. Texture names and
1026 the corresponding texture contents are local to the shared display-list
1027 space (see `glXCreateContext') of the current GL rendering context; two
1028 rendering contexts share texture names only if they also share display
1031 You may use `glGenTextures' to generate a set of new texture names.
1033 When a texture is first bound, it assumes the specified target: A
1034 texture first bound to `GL_TEXTURE_1D' becomes one-dimensional texture,
1035 a texture first bound to `GL_TEXTURE_2D' becomes two-dimensional
1036 texture, a texture first bound to `GL_TEXTURE_3D' becomes
1037 three-dimensional texture, and a texture first bound to
1038 `GL_TEXTURE_CUBE_MAP' becomes a cube-mapped texture. The state of a
1039 one-dimensional texture immediately after it is first bound is
1040 equivalent to the state of the default `GL_TEXTURE_1D' at GL
1041 initialization, and similarly for two- and three-dimensional textures
1042 and cube-mapped textures.
1044 While a texture is bound, GL operations on the target to which it is
1045 bound affect the bound texture, and queries of the target to which it is
1046 bound return state from the bound texture. If texture mapping is active
1047 on the target to which a texture is bound, the bound texture is used. In
1048 effect, the texture targets become aliases for the textures currently
1049 bound to them, and the texture name zero refers to the default textures
1050 that were bound to them at initialization.
1052 A texture binding created with `glBindTexture' remains active until a
1053 different texture is bound to the same target, or until the bound
1054 texture is deleted with `glDeleteTextures'.
1056 Once created, a named texture may be re-bound to its same original
1057 target as often as needed. It is usually much faster to use
1058 `glBindTexture' to bind an existing named texture to one of the texture
1059 targets than it is to reload the texture image using `glTexImage1D',
1060 `glTexImage2D', or `glTexImage3D'. For additional control over
1061 performance, use `glPrioritizeTextures'.
1063 `glBindTexture' is included in display lists.
1065 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
1068 `GL_INVALID_OPERATION' is generated if TEXTURE was previously created
1069 with a target that doesn't match that of TARGET.
1071 `GL_INVALID_OPERATION' is generated if `glBindTexture' is executed
1072 between the execution of `glBegin' and the corresponding execution of
1075 (define-gl-procedure
1091 Specify the pixel width and height of the bitmap image.
1096 Specify the location of the origin in the bitmap image. The origin
1097 is measured from the lower left corner of the bitmap, with right
1098 and up being the positive axes.
1103 Specify the X and Y offsets to be added to the current raster
1104 position after the bitmap is drawn.
1107 Specifies the address of the bitmap image.
1109 A bitmap is a binary image. When drawn, the bitmap is positioned
1110 relative to the current raster position, and frame buffer pixels
1111 corresponding to 1's in the bitmap are written using the current raster
1112 color or index. Frame buffer pixels corresponding to 0's in the bitmap
1115 `glBitmap' takes seven arguments. The first pair specifies the width and
1116 height of the bitmap image. The second pair specifies the location of
1117 the bitmap origin relative to the lower left corner of the bitmap image.
1118 The third pair of arguments specifies X and Y offsets to be added to the
1119 current raster position after the bitmap has been drawn. The final
1120 argument is a pointer to the bitmap image itself.
1122 If a non-zero named buffer object is bound to the
1123 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a bitmap
1124 image is specified, BITMAP is treated as a byte offset into the buffer
1125 object's data store.
1127 The bitmap image is interpreted like image data for the `glDrawPixels'
1128 command, with WIDTH and HEIGHT corresponding to the width and height
1129 arguments of that command, and with TYPE set to `GL_BITMAP' and FORMAT
1130 set to `GL_COLOR_INDEX'. Modes specified using `glPixelStore' affect the
1131 interpretation of bitmap image data; modes specified using
1132 `glPixelTransfer' do not.
1134 If the current raster position is invalid, `glBitmap' is ignored.
1135 Otherwise, the lower left corner of the bitmap image is positioned at
1136 the window coordinates
1142 where (X_R,Y_R) is the raster position and (X_O,Y_O) is the bitmap
1143 origin. Fragments are then generated for each pixel corresponding to a 1
1144 (one) in the bitmap image. These fragments are generated using the
1145 current raster Z coordinate, color or color index, and current raster
1146 texture coordinates. They are then treated just as if they had been
1147 generated by a point, line, or polygon, including texture mapping,
1148 fogging, and all per-fragment operations such as alpha and depth
1151 After the bitmap has been drawn, the X and Y coordinates of the current
1152 raster position are offset by XMOVE and YMOVE. No change is made to the
1153 Z coordinate of the current raster position, or to the current raster
1154 color, texture coordinates, or index.
1156 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is negative.
1158 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1159 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
1160 data store is currently mapped.
1162 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1163 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
1164 unpacked from the buffer object such that the memory reads required
1165 would exceed the data store size.
1167 `GL_INVALID_OPERATION' is generated if `glBitmap' is executed between
1168 the execution of `glBegin' and the corresponding execution of `glEnd'.")
1170 (define-gl-procedure
1178 "Set the blend color.
1187 specify the components of `GL_BLEND_COLOR'
1189 The `GL_BLEND_COLOR' may be used to calculate the source and destination
1190 blending factors. The color components are clamped to the range [0,1]
1191 before being stored. See `glBlendFunc' for a complete description of the
1192 blending operations. Initially the `GL_BLEND_COLOR' is set to (0, 0, 0,
1195 `GL_INVALID_OPERATION' is generated if `glBlendColor' is executed
1196 between the execution of `glBegin' and the corresponding execution of
1199 (define-gl-procedure
1200 ((glBlendEquationSeparate
1205 "Set the RGB blend equation and the alpha blend equation separately.
1208 specifies the RGB blend equation, how the red, green, and blue
1209 components of the source and destination colors are combined. It
1210 must be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
1211 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN', `GL_MAX'.
1214 specifies the alpha blend equation, how the alpha component of the
1215 source and destination colors are combined. It must be
1216 `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1219 The blend equations determines how a new pixel (the ''source'' color) is
1220 combined with a pixel already in the framebuffer (the ''destination''
1221 color). This function specifies one blend equation for the RGB-color
1222 components and one blend equation for the alpha component.
1224 The blend equations use the source and destination blend factors
1225 specified by either `glBlendFunc' or `glBlendFuncSeparate'. See
1226 `glBlendFunc' or `glBlendFuncSeparate' for a description of the various
1229 In the equations that follow, source and destination color components
1230 are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1231 The result color is referred to as (R_R,G_RB_RA_R) . The source and
1232 destination blend factors are denoted (S_R,S_GS_BS_A) and
1233 (D_R,D_GD_BD_A) , respectively. For these equations all color components
1234 are understood to have values in the range [0,1] .
1237 *RGB Components*, *Alpha Component*
1240 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 ,
1241 AR=A_S\u2062S_A+A_D\u2062D_A
1244 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 ,
1245 AR=A_S\u2062S_A-A_D\u2062D_A
1247 `GL_FUNC_REVERSE_SUBTRACT'
1248 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 ,
1249 AR=A_D\u2062D_A-A_S\u2062S_A
1252 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1253 AR=MIN\u2061(A_S,A_D)
1256 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1257 AR=MAX\u2061(A_S,A_D)
1259 The results of these equations are clamped to the range [0,1] .
1261 The `GL_MIN' and `GL_MAX' equations are useful for applications that
1262 analyze image data (image thresholding against a constant color, for
1263 example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1264 transparency, among other things.
1266 Initially, both the RGB blend equation and the alpha blend equation are
1267 set to `GL_FUNC_ADD'.
1271 `GL_INVALID_ENUM' is generated if either MODERGB or MODEALPHA is not one
1272 of `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1273 `GL_MAX', or `GL_MIN'.
1275 `GL_INVALID_OPERATION' is generated if `glBlendEquationSeparate' is
1276 executed between the execution of `glBegin' and the corresponding
1277 execution of `glEnd'.")
1279 (define-gl-procedure
1280 ((glBlendEquation (mode GLenum) -> void))
1281 "Specify the equation used for both the RGB blend equation and the Alpha
1285 specifies how source and destination colors are combined. It must
1286 be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1289 The blend equations determine how a new pixel (the ''source'' color) is
1290 combined with a pixel already in the framebuffer (the ''destination''
1291 color). This function sets both the RGB blend equation and the alpha
1292 blend equation to a single equation.
1294 These equations use the source and destination blend factors specified
1295 by either `glBlendFunc' or `glBlendFuncSeparate'. See `glBlendFunc' or
1296 `glBlendFuncSeparate' for a description of the various blend factors.
1298 In the equations that follow, source and destination color components
1299 are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1300 The result color is referred to as (R_R,G_RB_RA_R) . The source and
1301 destination blend factors are denoted (S_R,S_GS_BS_A) and
1302 (D_R,D_GD_BD_A) , respectively. For these equations all color components
1303 are understood to have values in the range [0,1] .
1306 *RGB Components*, *Alpha Component*
1309 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 ,
1310 AR=A_S\u2062S_A+A_D\u2062D_A
1313 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 ,
1314 AR=A_S\u2062S_A-A_D\u2062D_A
1316 `GL_FUNC_REVERSE_SUBTRACT'
1317 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 ,
1318 AR=A_D\u2062D_A-A_S\u2062S_A
1321 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1322 AR=MIN\u2061(A_S,A_D)
1325 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1326 AR=MAX\u2061(A_S,A_D)
1328 The results of these equations are clamped to the range [0,1] .
1330 The `GL_MIN' and `GL_MAX' equations are useful for applications that
1331 analyze image data (image thresholding against a constant color, for
1332 example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1333 transparency, among other things.
1335 Initially, both the RGB blend equation and the alpha blend equation are
1336 set to `GL_FUNC_ADD'.
1340 `GL_INVALID_ENUM' is generated if MODE is not one of `GL_FUNC_ADD',
1341 `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', `GL_MAX', or `GL_MIN'.
1343 `GL_INVALID_OPERATION' is generated if `glBlendEquation' is executed
1344 between the execution of `glBegin' and the corresponding execution of
1347 (define-gl-procedure
1348 ((glBlendFuncSeparate
1355 "Specify pixel arithmetic for RGB and alpha components separately.
1358 Specifies how the red, green, and blue blending factors are
1359 computed. The following symbolic constants are accepted: `GL_ZERO',
1360 `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR',
1361 `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA',
1362 `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1363 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1364 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1365 initial value is `GL_ONE'.
1368 Specifies how the red, green, and blue destination blending factors
1369 are computed. The following symbolic constants are accepted:
1370 `GL_ZERO', `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR',
1371 `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA',
1372 `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA'.
1373 `GL_CONSTANT_COLOR', `GL_ONE_MINUS_CONSTANT_COLOR',
1374 `GL_CONSTANT_ALPHA', and `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial
1378 Specified how the alpha source blending factor is computed. The
1379 same symbolic constants are accepted as for SRCRGB. The initial
1383 Specified how the alpha destination blending factor is computed.
1384 The same symbolic constants are accepted as for DSTRGB. The initial
1387 In RGBA mode, pixels can be drawn using a function that blends the
1388 incoming (source) RGBA values with the RGBA values that are already in
1389 the frame buffer (the destination values). Blending is initially
1390 disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1391 enable and disable blending.
1393 `glBlendFuncSeparate' defines the operation of blending when it is
1394 enabled. SRCRGB specifies which method is used to scale the source
1395 RGB-color components. DSTRGB specifies which method is used to scale the
1396 destination RGB-color components. Likewise, SRCALPHA specifies which
1397 method is used to scale the source alpha color component, and DSTALPHA
1398 specifies which method is used to scale the destination alpha component.
1399 The possible methods are described in the following table. Each method
1400 defines four scale factors, one each for red, green, blue, and alpha.
1402 In the table and in subsequent equations, source and destination color
1403 components are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The
1404 color specified by `glBlendColor' is referred to as (R_C,G_CB_CA_C) .
1405 They are understood to have integer values between 0 and (K_R,K_GK_BK_A)
1410 and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1413 Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1414 and (D_R,D_GD_BD_A) . All scale factors have range [0,1] .
1419 *RGB Factor*, *Alpha Factor*
1428 (R_S/K_R,G_S/K_GB_S/K_B) , A_S/K_A
1430 `GL_ONE_MINUS_SRC_COLOR'
1431 (1,111)-(R_S/K_R,G_S/K_GB_S/K_B) , 1-A_S/K_A
1434 (R_D/K_R,G_D/K_GB_D/K_B) , A_D/K_A
1436 `GL_ONE_MINUS_DST_COLOR'
1437 (1,11)-(R_D/K_R,G_D/K_GB_D/K_B) , 1-A_D/K_A
1440 (A_S/K_A,A_S/K_AA_S/K_A) , A_S/K_A
1442 `GL_ONE_MINUS_SRC_ALPHA'
1443 (1,11)-(A_S/K_A,A_S/K_AA_S/K_A) , 1-A_S/K_A
1446 (A_D/K_A,A_D/K_AA_D/K_A) , A_D/K_A
1448 `GL_ONE_MINUS_DST_ALPHA'
1449 (1,11)-(A_D/K_A,A_D/K_AA_D/K_A) , 1-A_D/K_A
1454 `GL_ONE_MINUS_CONSTANT_COLOR'
1455 (1,11)-(R_C,G_CB_C) , 1-A_C
1460 `GL_ONE_MINUS_CONSTANT_ALPHA'
1461 (1,11)-(A_C,A_CA_C) , 1-A_C
1463 `GL_SRC_ALPHA_SATURATE'
1468 I=MIN\u2061(A_S,1-A_D,)
1470 To determine the blended RGBA values of a pixel when drawing in RGBA
1471 mode, the system uses the following equations:
1473 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)
1474 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)
1476 Despite the apparent precision of the above equations, blending
1477 arithmetic is not exactly specified, because blending operates with
1478 imprecise integer color values. However, a blend factor that should be
1479 equal to 1 is guaranteed not to modify its multiplicand, and a blend
1480 factor equal to 0 reduces its multiplicand to 0. For example, when
1481 SRCRGB is `GL_SRC_ALPHA', DSTRGB is `GL_ONE_MINUS_SRC_ALPHA', and A_S is
1482 equal to K_A , the equations reduce to simple replacement:
1484 R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1488 `GL_INVALID_ENUM' is generated if either SRCRGB or DSTRGB is not an
1491 `GL_INVALID_OPERATION' is generated if `glBlendFuncSeparate' is executed
1492 between the execution of `glBegin' and the corresponding execution of
1495 (define-gl-procedure
1501 "Specify pixel arithmetic.
1504 Specifies how the red, green, blue, and alpha source blending
1505 factors are computed. The following symbolic constants are
1506 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1507 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1508 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1509 `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1510 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1511 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1512 initial value is `GL_ONE'.
1515 Specifies how the red, green, blue, and alpha destination blending
1516 factors are computed. The following symbolic constants are
1517 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1518 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1519 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1520 `GL_ONE_MINUS_DST_ALPHA'. `GL_CONSTANT_COLOR',
1521 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA', and
1522 `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial value is `GL_ZERO'.
1524 In RGBA mode, pixels can be drawn using a function that blends the
1525 incoming (source) RGBA values with the RGBA values that are already in
1526 the frame buffer (the destination values). Blending is initially
1527 disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1528 enable and disable blending.
1530 `glBlendFunc' defines the operation of blending when it is enabled.
1531 SFACTOR specifies which method is used to scale the source color
1532 components. DFACTOR specifies which method is used to scale the
1533 destination color components. The possible methods are described in the
1534 following table. Each method defines four scale factors, one each for
1535 red, green, blue, and alpha. In the table and in subsequent equations,
1536 source and destination color components are referred to as
1537 (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The color specified by
1538 `glBlendColor' is referred to as (R_C,G_CB_CA_C) . They are understood
1539 to have integer values between 0 and (K_R,K_GK_BK_A) , where
1543 and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1546 Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1547 and (D_R,D_GD_BD_A) . The scale factors described in the table, denoted
1548 (F_R,F_GF_BF_A) , represent either source or destination factors. All
1549 scale factors have range [0,1] .
1563 (R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1565 `GL_ONE_MINUS_SRC_COLOR'
1566 (1,111)-(R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1569 (R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1571 `GL_ONE_MINUS_DST_COLOR'
1572 (1,111)-(R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1575 (A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1577 `GL_ONE_MINUS_SRC_ALPHA'
1578 (1,111)-(A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1581 (A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1583 `GL_ONE_MINUS_DST_ALPHA'
1584 (1,111)-(A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1589 `GL_ONE_MINUS_CONSTANT_COLOR'
1590 (1,111)-(R_C,G_CB_CA_C)
1595 `GL_ONE_MINUS_CONSTANT_ALPHA'
1596 (1,111)-(A_C,A_CA_CA_C)
1598 `GL_SRC_ALPHA_SATURATE'
1603 I=MIN\u2061(A_S,K_A-A_D)/K_A
1605 To determine the blended RGBA values of a pixel when drawing in RGBA
1606 mode, the system uses the following equations:
1608 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)
1609 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)
1611 Despite the apparent precision of the above equations, blending
1612 arithmetic is not exactly specified, because blending operates with
1613 imprecise integer color values. However, a blend factor that should be
1614 equal to 1 is guaranteed not to modify its multiplicand, and a blend
1615 factor equal to 0 reduces its multiplicand to 0. For example, when
1616 SFACTOR is `GL_SRC_ALPHA', DFACTOR is `GL_ONE_MINUS_SRC_ALPHA', and A_S
1617 is equal to K_A , the equations reduce to simple replacement:
1619 R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1623 `GL_INVALID_ENUM' is generated if either SFACTOR or DFACTOR is not an
1626 `GL_INVALID_OPERATION' is generated if `glBlendFunc' is executed between
1627 the execution of `glBegin' and the corresponding execution of `glEnd'.")
1629 (define-gl-procedure
1637 "Creates and initializes a buffer object's data store.
1640 Specifies the target buffer object. The symbolic constant must be
1641 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1642 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1645 Specifies the size in bytes of the buffer object's new data store.
1648 Specifies a pointer to data that will be copied into the data store
1649 for initialization, or `NULL' if no data is to be copied.
1652 Specifies the expected usage pattern of the data store. The
1653 symbolic constant must be `GL_STREAM_DRAW', `GL_STREAM_READ',
1654 `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1655 `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1658 `glBufferData' creates a new data store for the buffer object currently
1659 bound to TARGET. Any pre-existing data store is deleted. The new data
1660 store is created with the specified SIZE in bytes and USAGE. If DATA is
1661 not `NULL', the data store is initialized with data from this pointer.
1662 In its initial state, the new data store is not mapped, it has a `NULL'
1663 mapped pointer, and its mapped access is `GL_READ_WRITE'.
1665 USAGE is a hint to the GL implementation as to how a buffer object's
1666 data store will be accessed. This enables the GL implementation to make
1667 more intelligent decisions that may significantly impact buffer object
1668 performance. It does not, however, constrain the actual usage of the
1669 data store. USAGE can be broken down into two parts: first, the
1670 frequency of access (modification and usage), and second, the nature of
1671 that access. The frequency of access may be one of these:
1674 The data store contents will be modified once and used at most a
1678 The data store contents will be modified once and used many times.
1681 The data store contents will be modified repeatedly and used many
1684 The nature of access may be one of these:
1687 The data store contents are modified by the application, and used
1688 as the source for GL drawing and image specification commands.
1691 The data store contents are modified by reading data from the GL,
1692 and used to return that data when queried by the application.
1695 The data store contents are modified by reading data from the GL,
1696 and used as the source for GL drawing and image specification
1699 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1700 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1701 `GL_PIXEL_UNPACK_BUFFER'.
1703 `GL_INVALID_ENUM' is generated if USAGE is not `GL_STREAM_DRAW',
1704 `GL_STREAM_READ', `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1705 `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1708 `GL_INVALID_VALUE' is generated if SIZE is negative.
1710 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1713 `GL_OUT_OF_MEMORY' is generated if the GL is unable to create a data
1714 store with the specified SIZE.
1716 `GL_INVALID_OPERATION' is generated if `glBufferData' is executed
1717 between the execution of `glBegin' and the corresponding execution of
1720 (define-gl-procedure
1728 "Updates a subset of a buffer object's data store.
1731 Specifies the target buffer object. The symbolic constant must be
1732 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1733 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1736 Specifies the offset into the buffer object's data store where data
1737 replacement will begin, measured in bytes.
1740 Specifies the size in bytes of the data store region being
1744 Specifies a pointer to the new data that will be copied into the
1747 `glBufferSubData' redefines some or all of the data store for the buffer
1748 object currently bound to TARGET. Data starting at byte offset OFFSET
1749 and extending for SIZE bytes is copied to the data store from the memory
1750 pointed to by DATA. An error is thrown if OFFSET and SIZE together
1751 define a range beyond the bounds of the buffer object's data store.
1753 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1754 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1755 `GL_PIXEL_UNPACK_BUFFER'.
1757 `GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
1758 together they define a region of memory that extends beyond the buffer
1759 object's allocated data store.
1761 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1764 `GL_INVALID_OPERATION' is generated if the buffer object being updated
1767 `GL_INVALID_OPERATION' is generated if `glBufferSubData' is executed
1768 between the execution of `glBegin' and the corresponding execution of
1771 (define-gl-procedure
1778 "Execute a list of display lists.
1781 Specifies the number of display lists to be executed.
1784 Specifies the type of values in LISTS. Symbolic constants
1785 `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT',
1786 `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES',
1787 `GL_3_BYTES', and `GL_4_BYTES' are accepted.
1790 Specifies the address of an array of name offsets in the display
1791 list. The pointer type is void because the offsets can be bytes,
1792 shorts, ints, or floats, depending on the value of TYPE.
1794 `glCallLists' causes each display list in the list of names passed as
1795 LISTS to be executed. As a result, the commands saved in each display
1796 list are executed in order, just as if they were called without using a
1797 display list. Names of display lists that have not been defined are
1800 `glCallLists' provides an efficient means for executing more than one
1801 display list. TYPE allows lists with various name formats to be
1802 accepted. The formats are as follows:
1805 LISTS is treated as an array of signed bytes, each in the range
1809 LISTS is treated as an array of unsigned bytes, each in the range 0
1813 LISTS is treated as an array of signed two-byte integers, each in
1814 the range -32768 through 32767.
1817 LISTS is treated as an array of unsigned two-byte integers, each in
1818 the range 0 through 65535.
1821 LISTS is treated as an array of signed four-byte integers.
1824 LISTS is treated as an array of unsigned four-byte integers.
1827 LISTS is treated as an array of four-byte floating-point values.
1830 LISTS is treated as an array of unsigned bytes. Each pair of bytes
1831 specifies a single display-list name. The value of the pair is
1832 computed as 256 times the unsigned value of the first byte plus the
1833 unsigned value of the second byte.
1836 LISTS is treated as an array of unsigned bytes. Each triplet of
1837 bytes specifies a single display-list name. The value of the
1838 triplet is computed as 65536 times the unsigned value of the first
1839 byte, plus 256 times the unsigned value of the second byte, plus
1840 the unsigned value of the third byte.
1843 LISTS is treated as an array of unsigned bytes. Each quadruplet of
1844 bytes specifies a single display-list name. The value of the
1845 quadruplet is computed as 16777216 times the unsigned value of the
1846 first byte, plus 65536 times the unsigned value of the second byte,
1847 plus 256 times the unsigned value of the third byte, plus the
1848 unsigned value of the fourth byte.
1850 The list of display-list names is not null-terminated. Rather, N
1851 specifies how many names are to be taken from LISTS.
1853 An additional level of indirection is made available with the
1854 `glListBase' command, which specifies an unsigned offset that is added
1855 to each display-list name specified in LISTS before that display list is
1858 `glCallLists' can appear inside a display list. To avoid the possibility
1859 of infinite recursion resulting from display lists calling one another,
1860 a limit is placed on the nesting level of display lists during
1861 display-list execution. This limit must be at least 64, and it depends
1862 on the implementation.
1864 GL state is not saved and restored across a call to `glCallLists'. Thus,
1865 changes made to GL state during the execution of the display lists
1866 remain after execution is completed. Use `glPushAttrib', `glPopAttrib',
1867 `glPushMatrix', and `glPopMatrix' to preserve GL state across
1868 `glCallLists' calls.
1870 `GL_INVALID_VALUE' is generated if N is negative.
1872 `GL_INVALID_ENUM' is generated if TYPE is not one of `GL_BYTE',
1873 `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT', `GL_INT',
1874 `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES', `GL_3_BYTES', `GL_4_BYTES'.")
1876 (define-gl-procedure
1877 ((glCallList (list GLuint) -> void))
1878 "Execute a display list.
1881 Specifies the integer name of the display list to be executed.
1883 `glCallList' causes the named display list to be executed. The commands
1884 saved in the display list are executed in order, just as if they were
1885 called without using a display list. If LIST has not been defined as a
1886 display list, `glCallList' is ignored.
1888 `glCallList' can appear inside a display list. To avoid the possibility
1889 of infinite recursion resulting from display lists calling one another,
1890 a limit is placed on the nesting level of display lists during
1891 display-list execution. This limit is at least 64, and it depends on the
1894 GL state is not saved and restored across a call to `glCallList'. Thus,
1895 changes made to GL state during the execution of a display list remain
1896 after execution of the display list is completed. Use `glPushAttrib',
1897 `glPopAttrib', `glPushMatrix', and `glPopMatrix' to preserve GL state
1898 across `glCallList' calls.")
1900 (define-gl-procedure
1908 "Specify clear values for the accumulation buffer.
1917 Specify the red, green, blue, and alpha values used when the
1918 accumulation buffer is cleared. The initial values are all 0.
1920 `glClearAccum' specifies the red, green, blue, and alpha values used by
1921 `glClear' to clear the accumulation buffer.
1923 Values specified by `glClearAccum' are clamped to the range [-1,1] .
1925 `GL_INVALID_OPERATION' is generated if `glClearAccum' is executed
1926 between the execution of `glBegin' and the corresponding execution of
1929 (define-gl-procedure
1937 "Specify clear values for the color buffers.
1946 Specify the red, green, blue, and alpha values used when the color
1947 buffers are cleared. The initial values are all 0.
1949 `glClearColor' specifies the red, green, blue, and alpha values used by
1950 `glClear' to clear the color buffers. Values specified by `glClearColor'
1951 are clamped to the range [0,1] .
1953 `GL_INVALID_OPERATION' is generated if `glClearColor' is executed
1954 between the execution of `glBegin' and the corresponding execution of
1957 (define-gl-procedure
1958 ((glClearDepth (depth GLclampd) -> void))
1959 "Specify the clear value for the depth buffer.
1962 Specifies the depth value used when the depth buffer is cleared.
1963 The initial value is 1.
1965 `glClearDepth' specifies the depth value used by `glClear' to clear the
1966 depth buffer. Values specified by `glClearDepth' are clamped to the
1969 `GL_INVALID_OPERATION' is generated if `glClearDepth' is executed
1970 between the execution of `glBegin' and the corresponding execution of
1973 (define-gl-procedure
1974 ((glClearIndex (c GLfloat) -> void))
1975 "Specify the clear value for the color index buffers.
1978 Specifies the index used when the color index buffers are cleared.
1979 The initial value is 0.
1981 `glClearIndex' specifies the index used by `glClear' to clear the color
1982 index buffers. C is not clamped. Rather, C is converted to a fixed-point
1983 value with unspecified precision to the right of the binary point. The
1984 integer part of this value is then masked with 2^M-1 , where M is the
1985 number of bits in a color index stored in the frame buffer.
1987 `GL_INVALID_OPERATION' is generated if `glClearIndex' is executed
1988 between the execution of `glBegin' and the corresponding execution of
1991 (define-gl-procedure
1992 ((glClearStencil (s GLint) -> void))
1993 "Specify the clear value for the stencil buffer.
1996 Specifies the index used when the stencil buffer is cleared. The
1999 `glClearStencil' specifies the index used by `glClear' to clear the
2000 stencil buffer. S is masked with 2^M-1 , where M is the number of bits
2001 in the stencil buffer.
2003 `GL_INVALID_OPERATION' is generated if `glClearStencil' is executed
2004 between the execution of `glBegin' and the corresponding execution of
2007 (define-gl-procedure
2008 ((glClear (mask GLbitfield) -> void))
2009 "Clear buffers to preset values.
2012 Bitwise OR of masks that indicate the buffers to be cleared. The
2013 four masks are `GL_COLOR_BUFFER_BIT', `GL_DEPTH_BUFFER_BIT',
2014 `GL_ACCUM_BUFFER_BIT', and `GL_STENCIL_BUFFER_BIT'.
2016 `glClear' sets the bitplane area of the window to values previously
2017 selected by `glClearColor', `glClearIndex', `glClearDepth',
2018 `glClearStencil', and `glClearAccum'. Multiple color buffers can be
2019 cleared simultaneously by selecting more than one buffer at a time using
2022 The pixel ownership test, the scissor test, dithering, and the buffer
2023 writemasks affect the operation of `glClear'. The scissor box bounds the
2024 cleared region. Alpha function, blend function, logical operation,
2025 stenciling, texture mapping, and depth-buffering are ignored by
2028 `glClear' takes a single argument that is the bitwise OR of several
2029 values indicating which buffer is to be cleared.
2031 The values are as follows:
2033 `GL_COLOR_BUFFER_BIT'
2034 Indicates the buffers currently enabled for color writing.
2036 `GL_DEPTH_BUFFER_BIT'
2037 Indicates the depth buffer.
2039 `GL_ACCUM_BUFFER_BIT'
2040 Indicates the accumulation buffer.
2042 `GL_STENCIL_BUFFER_BIT'
2043 Indicates the stencil buffer.
2045 The value to which each buffer is cleared depends on the setting of the
2046 clear value for that buffer.
2048 `GL_INVALID_VALUE' is generated if any bit other than the four defined
2049 bits is set in MASK.
2051 `GL_INVALID_OPERATION' is generated if `glClear' is executed between the
2052 execution of `glBegin' and the corresponding execution of `glEnd'.")
2054 (define-gl-procedure
2055 ((glClientActiveTexture (texture GLenum) -> void))
2056 "Select active texture unit.
2059 Specifies which texture unit to make active. The number of texture
2060 units is implementation dependent, but must be at least two.
2061 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
2062 the value of `GL_MAX_TEXTURE_COORDS' - 1, which is an
2063 implementation-dependent value. The initial value is `GL_TEXTURE0'.
2065 `glClientActiveTexture' selects the vertex array client state parameters
2066 to be modified by `glTexCoordPointer', and enabled or disabled with
2067 `glEnableClientState' or `glDisableClientState', respectively, when
2068 called with a parameter of `GL_TEXTURE_COORD_ARRAY'.
2070 `GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
2071 where i ranges from 0 to the value of `GL_MAX_TEXTURE_COORDS' - 1.")
2073 (define-gl-procedure
2074 ((glClipPlane (plane GLenum) (equation *) -> void))
2075 "Specify a plane against which all geometry is clipped.
2078 Specifies which clipping plane is being positioned. Symbolic names
2079 of the form `GL_CLIP_PLANE'I, where I is an integer between 0 and
2080 `GL_MAX_CLIP_PLANES' -1 , are accepted.
2083 Specifies the address of an array of four double-precision
2084 floating-point values. These values are interpreted as a plane
2087 Geometry is always clipped against the boundaries of a six-plane frustum
2088 in X, Y, and Z. `glClipPlane' allows the specification of additional
2089 planes, not necessarily perpendicular to the X, Y, or Z axis, against
2090 which all geometry is clipped. To determine the maximum number of
2091 additional clipping planes, call `glGetIntegerv' with argument
2092 `GL_MAX_CLIP_PLANES'. All implementations support at least six such
2093 clipping planes. Because the resulting clipping region is the
2094 intersection of the defined half-spaces, it is always convex.
2096 `glClipPlane' specifies a half-space using a four-component plane
2097 equation. When `glClipPlane' is called, EQUATION is transformed by the
2098 inverse of the modelview matrix and stored in the resulting eye
2099 coordinates. Subsequent changes to the modelview matrix have no effect
2100 on the stored plane-equation components. If the dot product of the eye
2101 coordinates of a vertex with the stored plane equation components is
2102 positive or zero, the vertex is IN with respect to that clipping plane.
2103 Otherwise, it is OUT.
2105 To enable and disable clipping planes, call `glEnable' and `glDisable'
2106 with the argument `GL_CLIP_PLANE'I, where I is the plane number.
2108 All clipping planes are initially defined as (0, 0, 0, 0) in eye
2109 coordinates and are disabled.
2111 `GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
2113 `GL_INVALID_OPERATION' is generated if `glClipPlane' is executed between
2114 the execution of `glBegin' and the corresponding execution of `glEnd'.")
2116 (define-gl-procedure
2124 "Enable and disable writing of frame buffer color components.
2133 Specify whether red, green, blue, and alpha can or cannot be
2134 written into the frame buffer. The initial values are all
2135 `GL_TRUE', indicating that the color components can be written.
2137 `glColorMask' specifies whether the individual color components in the
2138 frame buffer can or cannot be written. If RED is `GL_FALSE', for
2139 example, no change is made to the red component of any pixel in any of
2140 the color buffers, regardless of the drawing operation attempted.
2142 Changes to individual bits of components cannot be controlled. Rather,
2143 changes are either enabled or disabled for entire color components.
2145 `GL_INVALID_OPERATION' is generated if `glColorMask' is executed between
2146 the execution of `glBegin' and the corresponding execution of `glEnd'.")
2148 (define-gl-procedure
2154 "Cause a material color to track the current color.
2157 Specifies whether front, back, or both front and back material
2158 parameters should track the current color. Accepted values are
2159 `GL_FRONT', `GL_BACK', and `GL_FRONT_AND_BACK'. The initial value
2160 is `GL_FRONT_AND_BACK'.
2163 Specifies which of several material parameters track the current
2164 color. Accepted values are `GL_EMISSION', `GL_AMBIENT',
2165 `GL_DIFFUSE', `GL_SPECULAR', and `GL_AMBIENT_AND_DIFFUSE'. The
2166 initial value is `GL_AMBIENT_AND_DIFFUSE'.
2168 `glColorMaterial' specifies which material parameters track the current
2169 color. When `GL_COLOR_MATERIAL' is enabled, the material parameter or
2170 parameters specified by MODE, of the material or materials specified by
2171 FACE, track the current color at all times.
2173 To enable and disable `GL_COLOR_MATERIAL', call `glEnable' and
2174 `glDisable' with argument `GL_COLOR_MATERIAL'. `GL_COLOR_MATERIAL' is
2177 `GL_INVALID_ENUM' is generated if FACE or MODE is not an accepted value.
2179 `GL_INVALID_OPERATION' is generated if `glColorMaterial' is executed
2180 between the execution of `glBegin' and the corresponding execution of
2183 (define-gl-procedure
2191 "Define an array of colors.
2194 Specifies the number of components per color. Must be 3 or 4. The
2198 Specifies the data type of each color component in the array.
2199 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
2200 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', and
2201 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
2204 Specifies the byte offset between consecutive colors. If STRIDE is
2205 0, the colors are understood to be tightly packed in the array. The
2209 Specifies a pointer to the first component of the first color
2210 element in the array. The initial value is 0.
2212 `glColorPointer' specifies the location and data format of an array of
2213 color components to use when rendering. SIZE specifies the number of
2214 components per color, and must be 3 or 4. TYPE specifies the data type
2215 of each color component, and STRIDE specifies the byte stride from one
2216 color to the next, allowing vertices and attributes to be packed into a
2217 single array or stored in separate arrays. (Single-array storage may be
2218 more efficient on some implementations; see `glInterleavedArrays'.)
2220 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
2221 target (see `glBindBuffer') while a color array is specified, POINTER is
2222 treated as a byte offset into the buffer object's data store. Also, the
2223 buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as color
2224 vertex array client-side state (`GL_COLOR_ARRAY_BUFFER_BINDING').
2226 When a color array is specified, SIZE, TYPE, STRIDE, and POINTER are
2227 saved as client-side state, in addition to the current vertex array
2228 buffer object binding.
2230 To enable and disable the color array, call `glEnableClientState' and
2231 `glDisableClientState' with the argument `GL_COLOR_ARRAY'. If enabled,
2232 the color array is used when `glDrawArrays', `glMultiDrawArrays',
2233 `glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
2234 `glArrayElement' is called.
2236 `GL_INVALID_VALUE' is generated if SIZE is not 3 or 4.
2238 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
2240 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
2242 (define-gl-procedure
2252 "Respecify a portion of a color table.
2255 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2256 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2259 The starting index of the portion of the color table to be
2263 The number of table entries to replace.
2266 The format of the pixel data in DATA. The allowable values are
2267 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2268 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
2271 The type of the pixel data in DATA. The allowable values are
2272 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2273 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2274 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2275 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2276 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2277 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2278 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2279 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2282 Pointer to a one-dimensional array of pixel data that is processed
2283 to replace the specified region of the color table.
2285 `glColorSubTable' is used to respecify a contiguous portion of a color
2286 table previously defined using `glColorTable'. The pixels referenced by
2287 DATA replace the portion of the existing table from indices START to
2288 START+COUNT-1 , inclusive. This region may not include any entries
2289 outside the range of the color table as it was originally specified. It
2290 is not an error to specify a subtexture with width of 0, but such a
2291 specification has no effect.
2293 If a non-zero named buffer object is bound to the
2294 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a portion of
2295 a color table is respecified, DATA is treated as a byte offset into the
2296 buffer object's data store.
2298 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2301 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2304 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2307 `GL_INVALID_VALUE' is generated if START+COUNT>WIDTH .
2309 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2310 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2311 data store is currently mapped.
2313 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2314 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2315 unpacked from the buffer object such that the memory reads required
2316 would exceed the data store size.
2318 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2319 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2320 divisible into the number of bytes needed to store in memory a datum
2323 `GL_INVALID_OPERATION' is generated if `glColorSubTable' is executed
2324 between the execution of `glBegin' and the corresponding execution of
2327 (define-gl-procedure
2330 (internalformat GLenum)
2337 "Define a color lookup table.
2340 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2341 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `GL_PROXY_COLOR_TABLE',
2342 `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
2343 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
2346 The internal format of the color table. The allowable values are
2347 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
2348 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
2349 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
2350 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
2351 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
2352 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
2353 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
2354 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
2355 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
2356 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', and `GL_RGBA16'.
2359 The number of entries in the color lookup table specified by DATA.
2362 The format of the pixel data in DATA. The allowable values are
2363 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2364 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
2367 The type of the pixel data in DATA. The allowable values are
2368 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2369 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2370 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2371 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2372 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2373 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2374 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2375 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2378 Pointer to a one-dimensional array of pixel data that is processed
2379 to build the color table.
2381 `glColorTable' may be used in two ways: to test the actual size and
2382 color resolution of a lookup table given a particular set of parameters,
2383 or to load the contents of a color lookup table. Use the targets
2384 `GL_PROXY_*' for the first case and the other targets for the second
2387 If a non-zero named buffer object is bound to the
2388 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a color table
2389 is specified, DATA is treated as a byte offset into the buffer object's
2392 If TARGET is `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
2393 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `glColorTable' builds a color lookup
2394 table from an array of pixels. The pixel array specified by WIDTH,
2395 FORMAT, TYPE, and DATA is extracted from memory and processed just as if
2396 `glDrawPixels' were called, but processing stops after the final
2397 expansion to RGBA is completed.
2399 The four scale parameters and the four bias parameters that are defined
2400 for the table are then used to scale and bias the R, G, B, and A
2401 components of each pixel. (Use `glColorTableParameter' to set these
2402 scale and bias parameters.)
2404 Next, the R, G, B, and A values are clamped to the range [0,1] . Each
2405 pixel is then converted to the internal format specified by
2406 INTERNALFORMAT. This conversion simply maps the component values of the
2407 pixel (R, G, B, and A) to the values included in the internal format
2408 (red, green, blue, alpha, luminance, and intensity). The mapping is as
2414 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
2422 `GL_LUMINANCE_ALPHA'
2434 Finally, the red, green, blue, alpha, luminance, and/or intensity
2435 components of the resulting pixels are stored in the color table. They
2436 form a one-dimensional table with indices in the range [0,WIDTH-1] .
2438 If TARGET is `GL_PROXY_*', `glColorTable' recomputes and stores the
2439 values of the proxy color table's state variables
2440 `GL_COLOR_TABLE_FORMAT', `GL_COLOR_TABLE_WIDTH',
2441 `GL_COLOR_TABLE_RED_SIZE', `GL_COLOR_TABLE_GREEN_SIZE',
2442 `GL_COLOR_TABLE_BLUE_SIZE', `GL_COLOR_TABLE_ALPHA_SIZE',
2443 `GL_COLOR_TABLE_LUMINANCE_SIZE', and `GL_COLOR_TABLE_INTENSITY_SIZE'.
2444 There is no effect on the image or state of any actual color table. If
2445 the specified color table is too large to be supported, then all the
2446 proxy state variables listed above are set to zero. Otherwise, the color
2447 table could be supported by `glColorTable' using the corresponding
2448 non-proxy target, and the proxy state variables are set as if that
2449 target were being defined.
2451 The proxy state variables can be retrieved by calling
2452 `glGetColorTableParameter' with a target of `GL_PROXY_*'. This allows
2453 the application to decide if a particular `glColorTable' command would
2454 succeed, and to determine what the resulting color table attributes
2457 If a color table is enabled, and its width is non-zero, then its
2458 contents are used to replace a subset of the components of each RGBA
2459 pixel group, based on the internal format of the table.
2461 Each pixel group has color components (R, G, B, A) that are in the range
2462 [0.0,1.0] . The color components are rescaled to the size of the color
2463 lookup table to form an index. Then a subset of the components based on
2464 the internal format of the table are replaced by the table entry
2465 selected by that index. If the color components and contents of the
2466 table are represented as follows:
2474 Table index computed from `R'
2477 Table index computed from `G'
2480 Table index computed from `B'
2483 Table index computed from `A'
2486 Luminance value at table index `i'
2489 Intensity value at table index `i'
2492 Red value at table index `i'
2495 Green value at table index `i'
2498 Blue value at table index `i'
2501 Alpha value at table index `i'
2503 then the result of color table lookup is as follows:
2508 *Resulting Texture Components*
2510 *Table Internal Format*
2514 `R', `G', `B', `A[a]'
2517 `L[r]', `L[g]', `L[b]', `At'
2519 `GL_LUMINANCE_ALPHA'
2520 `L[r]', `L[g]', `L[b]', `A[a]'
2523 `I[r]', `I[g]', `I[b]', `I[a]'
2526 `R[r]', `G[g]', `B[b]', `A'
2529 `R[r]', `G[g]', `B[b]', `A[a]'
2531 When `GL_COLOR_TABLE' is enabled, the colors resulting from the pixel
2532 map operation (if it is enabled) are mapped by the color lookup table
2533 before being passed to the convolution operation. The colors resulting
2534 from the convolution operation are modified by the post convolution
2535 color lookup table when `GL_POST_CONVOLUTION_COLOR_TABLE' is enabled.
2536 These modified colors are then sent to the color matrix operation.
2537 Finally, if `GL_POST_COLOR_MATRIX_COLOR_TABLE' is enabled, the colors
2538 resulting from the color matrix operation are mapped by the post color
2539 matrix color lookup table before being used by the histogram operation.
2543 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2546 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
2549 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2552 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2555 `GL_INVALID_VALUE' is generated if WIDTH is less than zero.
2557 `GL_TABLE_TOO_LARGE' is generated if the requested color table is too
2558 large to be supported by the implementation, and TARGET is not a
2559 `GL_PROXY_*' target.
2561 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2562 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2563 data store is currently mapped.
2565 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2566 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2567 unpacked from the buffer object such that the memory reads required
2568 would exceed the data store size.
2570 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2571 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2572 divisible into the number of bytes needed to store in memory a datum
2575 `GL_INVALID_OPERATION' is generated if `glColorTable' is executed
2576 between the execution of `glBegin' and the corresponding execution of
2579 (define-gl-procedure
2619 "Set the current color.
2626 Specify new red, green, and blue values for the current color.
2629 Specifies a new alpha value for the current color. Included only in
2630 the four-argument `glColor4' commands.
2632 The GL stores both a current single-valued color index and a current
2633 four-valued RGBA color. `glColor' sets a new four-valued RGBA color.
2634 `glColor' has two major variants: `glColor3' and `glColor4'. `glColor3'
2635 variants specify new red, green, and blue values explicitly and set the
2636 current alpha value to 1.0 (full intensity) implicitly. `glColor4'
2637 variants specify all four color components explicitly.
2639 `glColor3b', `glColor4b', `glColor3s', `glColor4s', `glColor3i', and
2640 `glColor4i' take three or four signed byte, short, or long integers as
2641 arguments. When *v* is appended to the name, the color commands can take
2642 a pointer to an array of such values.
2644 Current color values are stored in floating-point format, with
2645 unspecified mantissa and exponent sizes. Unsigned integer color
2646 components, when specified, are linearly mapped to floating-point values
2647 such that the largest representable value maps to 1.0 (full intensity),
2648 and 0 maps to 0.0 (zero intensity). Signed integer color components,
2649 when specified, are linearly mapped to floating-point values such that
2650 the most positive representable value maps to 1.0, and the most negative
2651 representable value maps to -1.0 . (Note that this mapping does not
2652 convert 0 precisely to 0.0.) Floating-point values are mapped directly.
2654 Neither floating-point nor signed integer values are clamped to the
2655 range [0,1] before the current color is updated. However, color
2656 components are clamped to this range before they are interpolated or
2657 written into a color buffer.")
2659 (define-gl-procedure
2660 ((glCompileShader (shader GLuint) -> void))
2661 "Compiles a shader object.
2664 Specifies the shader object to be compiled.
2666 `glCompileShader' compiles the source code strings that have been stored
2667 in the shader object specified by SHADER.
2669 The compilation status will be stored as part of the shader object's
2670 state. This value will be set to `GL_TRUE' if the shader was compiled
2671 without errors and is ready for use, and `GL_FALSE' otherwise. It can be
2672 queried by calling `glGetShader' with arguments SHADER and
2673 `GL_COMPILE_STATUS'.
2675 Compilation of a shader can fail for a number of reasons as specified by
2676 the OpenGL Shading Language Specification. Whether or not the
2677 compilation was successful, information about the compilation can be
2678 obtained from the shader object's information log by calling
2679 `glGetShaderInfoLog'.
2681 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
2684 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
2686 `GL_INVALID_OPERATION' is generated if `glCompileShader' is executed
2687 between the execution of `glBegin' and the corresponding execution of
2690 (define-gl-procedure
2691 ((glCompressedTexImage1D
2694 (internalformat GLenum)
2701 "Specify a one-dimensional texture image in a compressed format.
2704 Specifies the target texture. Must be `GL_TEXTURE_1D' or
2705 `GL_PROXY_TEXTURE_1D'.
2708 Specifies the level-of-detail number. Level 0 is the base image
2709 level. Level N is the Nth mipmap reduction image.
2712 Specifies the format of the compressed image data stored at address
2716 Specifies the width of the texture image including the border if
2717 any. If the GL version does not support non-power-of-two sizes,
2718 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2719 implementations support texture images that are at least 64 texels
2720 wide. The height of the 1D texture image is 1.
2723 Specifies the width of the border. Must be either 0 or 1.
2726 Specifies the number of unsigned bytes of image data starting at
2727 the address specified by DATA.
2730 Specifies a pointer to the compressed image data in memory.
2732 Texturing maps a portion of a specified texture image onto each
2733 graphical primitive for which texturing is enabled. To enable and
2734 disable one-dimensional texturing, call `glEnable' and `glDisable' with
2735 argument `GL_TEXTURE_1D'.
2737 `glCompressedTexImage1D' loads a previously defined, and retrieved,
2738 compressed one-dimensional texture image if TARGET is `GL_TEXTURE_1D'
2739 (see `glTexImage1D').
2741 If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
2742 of the texture image state is recalculated, checked for consistency, and
2743 checked against the implementation's capabilities. If the implementation
2744 cannot handle a texture of the requested texture size, it sets all of
2745 the image state to 0, but does not generate an error (see `glGetError').
2746 To query for an entire mipmap array, use an image array level greater
2749 INTERNALFORMAT must be extension-specified compressed-texture format.
2750 When a texture is loaded with `glTexImage1D' using a generic compressed
2751 texture format (e.g., `GL_COMPRESSED_RGB') the GL selects from one of
2752 its extensions supporting compressed textures. In order to load the
2753 compressed texture image using `glCompressedTexImage1D', query the
2754 compressed texture image's size and format using
2755 `glGetTexLevelParameter'.
2757 If a non-zero named buffer object is bound to the
2758 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2759 image is specified, DATA is treated as a byte offset into the buffer
2760 object's data store.
2762 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2763 compressed internal formats: `GL_COMPRESSED_ALPHA',
2764 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2765 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2767 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
2768 format, dimensions, and contents of the specified compressed image data.
2770 `GL_INVALID_OPERATION' is generated if parameter combinations are not
2771 supported by the specific compressed internal format as specified in the
2772 specific texture compression extension.
2774 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2775 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2776 data store is currently mapped.
2778 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2779 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2780 unpacked from the buffer object such that the memory reads required
2781 would exceed the data store size.
2783 `GL_INVALID_OPERATION' is generated if `glCompressedTexImage1D' is
2784 executed between the execution of `glBegin' and the corresponding
2785 execution of `glEnd'.
2787 Undefined results, including abnormal program termination, are generated
2788 if DATA is not encoded in a manner consistent with the extension
2789 specification defining the internal compression format.")
2791 (define-gl-procedure
2792 ((glCompressedTexImage2D
2795 (internalformat GLenum)
2803 "Specify a two-dimensional texture image in a compressed format.
2806 Specifies the target texture. Must be `GL_TEXTURE_2D',
2807 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
2808 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
2809 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
2810 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
2813 Specifies the level-of-detail number. Level 0 is the base image
2814 level. Level N is the Nth mipmap reduction image.
2817 Specifies the format of the compressed image data stored at address
2821 Specifies the width of the texture image including the border if
2822 any. If the GL version does not support non-power-of-two sizes,
2823 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2824 implementations support 2D texture images that are at least 64
2825 texels wide and cube-mapped texture images that are at least 16
2829 Specifies the height of the texture image including the border if
2830 any. If the GL version does not support non-power-of-two sizes,
2831 this value must be Must be 2^N+2\u2061(BORDER,) for some integer N . All
2832 implementations support 2D texture images that are at least 64
2833 texels high and cube-mapped texture images that are at least 16
2837 Specifies the width of the border. Must be either 0 or 1.
2840 Specifies the number of unsigned bytes of image data starting at
2841 the address specified by DATA.
2844 Specifies a pointer to the compressed image data in memory.
2846 Texturing maps a portion of a specified texture image onto each
2847 graphical primitive for which texturing is enabled. To enable and
2848 disable two-dimensional texturing, call `glEnable' and `glDisable' with
2849 argument `GL_TEXTURE_2D'. To enable and disable texturing using
2850 cube-mapped textures, call `glEnable' and `glDisable' with argument
2851 `GL_TEXTURE_CUBE_MAP'.
2853 `glCompressedTexImage2D' loads a previously defined, and retrieved,
2854 compressed two-dimensional texture image if TARGET is `GL_TEXTURE_2D'
2855 (see `glTexImage2D').
2857 If TARGET is `GL_PROXY_TEXTURE_2D', no data is read from DATA, but all
2858 of the texture image state is recalculated, checked for consistency, and
2859 checked against the implementation's capabilities. If the implementation
2860 cannot handle a texture of the requested texture size, it sets all of
2861 the image state to 0, but does not generate an error (see `glGetError').
2862 To query for an entire mipmap array, use an image array level greater
2865 INTERNALFORMAT must be an extension-specified compressed-texture format.
2866 When a texture is loaded with `glTexImage2D' using a generic compressed
2867 texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
2868 its extensions supporting compressed textures. In order to load the
2869 compressed texture image using `glCompressedTexImage2D', query the
2870 compressed texture image's size and format using
2871 `glGetTexLevelParameter'.
2873 If a non-zero named buffer object is bound to the
2874 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2875 image is specified, DATA is treated as a byte offset into the buffer
2876 object's data store.
2878 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2879 compressed internal formats: `GL_COMPRESSED_ALPHA',
2880 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2881 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2883 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
2884 format, dimensions, and contents of the specified compressed image data.
2886 `GL_INVALID_OPERATION' is generated if parameter combinations are not
2887 supported by the specific compressed internal format as specified in the
2888 specific texture compression extension.
2890 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2891 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2892 data store is currently mapped.
2894 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2895 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2896 unpacked from the buffer object such that the memory reads required
2897 would exceed the data store size.
2899 `GL_INVALID_OPERATION' is generated if `glCompressedTexImage2D' is
2900 executed between the execution of `glBegin' and the corresponding
2901 execution of `glEnd'.
2903 Undefined results, including abnormal program termination, are generated
2904 if DATA is not encoded in a manner consistent with the extension
2905 specification defining the internal compression format.")
2907 (define-gl-procedure
2908 ((glCompressedTexImage3D
2911 (internalformat GLenum)
2920 "Specify a three-dimensional texture image in a compressed format.
2923 Specifies the target texture. Must be `GL_TEXTURE_3D' or
2924 `GL_PROXY_TEXTURE_3D'.
2927 Specifies the level-of-detail number. Level 0 is the base image
2928 level. Level N is the Nth mipmap reduction image.
2931 Specifies the format of the compressed image data stored at address
2935 Specifies the width of the texture image including the border if
2936 any. If the GL version does not support non-power-of-two sizes,
2937 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2938 implementations support 3D texture images that are at least 16
2942 Specifies the height of the texture image including the border if
2943 any. If the GL version does not support non-power-of-two sizes,
2944 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2945 implementations support 3D texture images that are at least 16
2949 Specifies the depth of the texture image including the border if
2950 any. If the GL version does not support non-power-of-two sizes,
2951 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2952 implementations support 3D texture images that are at least 16
2956 Specifies the width of the border. Must be either 0 or 1.
2959 Specifies the number of unsigned bytes of image data starting at
2960 the address specified by DATA.
2963 Specifies a pointer to the compressed image data in memory.
2965 Texturing maps a portion of a specified texture image onto each
2966 graphical primitive for which texturing is enabled. To enable and
2967 disable three-dimensional texturing, call `glEnable' and `glDisable'
2968 with argument `GL_TEXTURE_3D'.
2970 `glCompressedTexImage3D' loads a previously defined, and retrieved,
2971 compressed three-dimensional texture image if TARGET is `GL_TEXTURE_3D'
2972 (see `glTexImage3D').
2974 If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
2975 of the texture image state is recalculated, checked for consistency, and
2976 checked against the implementation's capabilities. If the implementation
2977 cannot handle a texture of the requested texture size, it sets all of
2978 the image state to 0, but does not generate an error (see `glGetError').
2979 To query for an entire mipmap array, use an image array level greater
2982 INTERNALFORMAT must be an extension-specified compressed-texture format.
2983 When a texture is loaded with `glTexImage2D' using a generic compressed
2984 texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
2985 its extensions supporting compressed textures. In order to load the
2986 compressed texture image using `glCompressedTexImage3D', query the
2987 compressed texture image's size and format using
2988 `glGetTexLevelParameter'.
2990 If a non-zero named buffer object is bound to the
2991 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2992 image is specified, DATA is treated as a byte offset into the buffer
2993 object's data store.
2995 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2996 compressed internal formats: `GL_COMPRESSED_ALPHA',
2997 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2998 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
3000 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3001 format, dimensions, and contents of the specified compressed image data.
3003 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3004 supported by the specific compressed internal format as specified in the
3005 specific texture compression extension.
3007 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3008 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3009 data store is currently mapped.
3011 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3012 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3013 unpacked from the buffer object such that the memory reads required
3014 would exceed the data store size.
3016 `GL_INVALID_OPERATION' is generated if `glCompressedTexImage3D' is
3017 executed between the execution of `glBegin' and the corresponding
3018 execution of `glEnd'.
3020 Undefined results, including abnormal program termination, are generated
3021 if DATA is not encoded in a manner consistent with the extension
3022 specification defining the internal compression format.")
3024 (define-gl-procedure
3025 ((glCompressedTexSubImage1D
3035 "Specify a one-dimensional texture subimage in a compressed format.
3038 Specifies the target texture. Must be `GL_TEXTURE_1D'.
3041 Specifies the level-of-detail number. Level 0 is the base image
3042 level. Level N is the Nth mipmap reduction image.
3045 Specifies a texel offset in the x direction within the texture
3049 Specifies the width of the texture subimage.
3052 Specifies the format of the compressed image data stored at address
3056 Specifies the number of unsigned bytes of image data starting at
3057 the address specified by DATA.
3060 Specifies a pointer to the compressed image data in memory.
3062 Texturing maps a portion of a specified texture image onto each
3063 graphical primitive for which texturing is enabled. To enable and
3064 disable one-dimensional texturing, call `glEnable' and `glDisable' with
3065 argument `GL_TEXTURE_1D'.
3067 `glCompressedTexSubImage1D' redefines a contiguous subregion of an
3068 existing one-dimensional texture image. The texels referenced by DATA
3069 replace the portion of the existing texture array with x indices XOFFSET
3070 and XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
3071 outside the range of the texture array as it was originally specified.
3072 It is not an error to specify a subtexture with width of 0, but such a
3073 specification has no effect.
3075 FORMAT must be an extension-specified compressed-texture format. The
3076 FORMAT of the compressed texture image is selected by the GL
3077 implementation that compressed it (see `glTexImage1D'), and should be
3078 queried at the time the texture was compressed with
3079 `glGetTexLevelParameter'.
3081 If a non-zero named buffer object is bound to the
3082 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3083 image is specified, DATA is treated as a byte offset into the buffer
3084 object's data store.
3086 `GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3087 compressed internal formats: `GL_COMPRESSED_ALPHA',
3088 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3089 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3090 `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3091 `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3092 `GL_COMPRESSED_SRGB_ALPHA'.
3094 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3095 format, dimensions, and contents of the specified compressed image data.
3097 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3098 supported by the specific compressed internal format as specified in the
3099 specific texture compression extension.
3101 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3102 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3103 data store is currently mapped.
3105 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3106 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3107 unpacked from the buffer object such that the memory reads required
3108 would exceed the data store size.
3110 `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage1D' is
3111 executed between the execution of `glBegin' and the corresponding
3112 execution of `glEnd'.
3114 Undefined results, including abnormal program termination, are generated
3115 if DATA is not encoded in a manner consistent with the extension
3116 specification defining the internal compression format.")
3118 (define-gl-procedure
3119 ((glCompressedTexSubImage2D
3131 "Specify a two-dimensional texture subimage in a compressed format.
3134 Specifies the target texture. Must be `GL_TEXTURE_2D',
3135 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
3136 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
3137 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
3138 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
3141 Specifies the level-of-detail number. Level 0 is the base image
3142 level. Level N is the Nth mipmap reduction image.
3145 Specifies a texel offset in the x direction within the texture
3149 Specifies a texel offset in the y direction within the texture
3153 Specifies the width of the texture subimage.
3156 Specifies the height of the texture subimage.
3159 Specifies the format of the compressed image data stored at address
3163 Specifies the number of unsigned bytes of image data starting at
3164 the address specified by DATA.
3167 Specifies a pointer to the compressed image data in memory.
3169 Texturing maps a portion of a specified texture image onto each
3170 graphical primitive for which texturing is enabled. To enable and
3171 disable two-dimensional texturing, call `glEnable' and `glDisable' with
3172 argument `GL_TEXTURE_2D'. To enable and disable texturing using
3173 cube-mapped texture, call `glEnable' and `glDisable' with argument
3174 `GL_TEXTURE_CUBE_MAP'.
3176 `glCompressedTexSubImage2D' redefines a contiguous subregion of an
3177 existing two-dimensional texture image. The texels referenced by DATA
3178 replace the portion of the existing texture array with x indices XOFFSET
3179 and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3180 inclusive. This region may not include any texels outside the range of
3181 the texture array as it was originally specified. It is not an error to
3182 specify a subtexture with width of 0, but such a specification has no
3185 FORMAT must be an extension-specified compressed-texture format. The
3186 FORMAT of the compressed texture image is selected by the GL
3187 implementation that compressed it (see `glTexImage2D') and should be
3188 queried at the time the texture was compressed with
3189 `glGetTexLevelParameter'.
3191 If a non-zero named buffer object is bound to the
3192 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3193 image is specified, DATA is treated as a byte offset into the buffer
3194 object's data store.
3196 `GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3197 compressed internal formats: `GL_COMPRESSED_ALPHA',
3198 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3199 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3200 `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3201 `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3202 `GL_COMPRESSED_SRGB_ALPHA'.
3204 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3205 format, dimensions, and contents of the specified compressed image data.
3207 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3208 supported by the specific compressed internal format as specified in the
3209 specific texture compression extension.
3211 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3212 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3213 data store is currently mapped.
3215 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3216 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3217 unpacked from the buffer object such that the memory reads required
3218 would exceed the data store size.
3220 `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage2D' is
3221 executed between the execution of `glBegin' and the corresponding
3222 execution of `glEnd'.
3224 Undefined results, including abnormal program termination, are generated
3225 if DATA is not encoded in a manner consistent with the extension
3226 specification defining the internal compression format.")
3228 (define-gl-procedure
3229 ((glCompressedTexSubImage3D
3243 "Specify a three-dimensional texture subimage in a compressed format.
3246 Specifies the target texture. Must be `GL_TEXTURE_3D'.
3249 Specifies the level-of-detail number. Level 0 is the base image
3250 level. Level N is the Nth mipmap reduction image.
3253 Specifies a texel offset in the x direction within the texture
3257 Specifies a texel offset in the y direction within the texture
3261 Specifies the width of the texture subimage.
3264 Specifies the height of the texture subimage.
3267 Specifies the depth of the texture subimage.
3270 Specifies the format of the compressed image data stored at address
3274 Specifies the number of unsigned bytes of image data starting at
3275 the address specified by DATA.
3278 Specifies a pointer to the compressed image data in memory.
3280 Texturing maps a portion of a specified texture image onto each
3281 graphical primitive for which texturing is enabled. To enable and
3282 disable three-dimensional texturing, call `glEnable' and `glDisable'
3283 with argument `GL_TEXTURE_3D'.
3285 `glCompressedTexSubImage3D' redefines a contiguous subregion of an
3286 existing three-dimensional texture image. The texels referenced by DATA
3287 replace the portion of the existing texture array with x indices XOFFSET
3288 and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3289 and the z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This region
3290 may not include any texels outside the range of the texture array as it
3291 was originally specified. It is not an error to specify a subtexture
3292 with width of 0, but such a specification has no effect.
3294 FORMAT must be an extension-specified compressed-texture format. The
3295 FORMAT of the compressed texture image is selected by the GL
3296 implementation that compressed it (see `glTexImage3D') and should be
3297 queried at the time the texture was compressed with
3298 `glGetTexLevelParameter'.
3300 If a non-zero named buffer object is bound to the
3301 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3302 image is specified, DATA is treated as a byte offset into the buffer
3303 object's data store.
3305 `GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3306 compressed internal formats: `GL_COMPRESSED_ALPHA',
3307 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3308 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3309 `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3310 `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3311 `GL_COMPRESSED_SRGB_ALPHA'.
3313 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3314 format, dimensions, and contents of the specified compressed image data.
3316 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3317 supported by the specific compressed internal format as specified in the
3318 specific texture compression extension.
3320 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3321 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3322 data store is currently mapped.
3324 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3325 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3326 unpacked from the buffer object such that the memory reads required
3327 would exceed the data store size.
3329 `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage3D' is
3330 executed between the execution of `glBegin' and the corresponding
3331 execution of `glEnd'.
3333 Undefined results, including abnormal program termination, are generated
3334 if DATA is not encoded in a manner consistent with the extension
3335 specification defining the internal compression format.")
3337 (define-gl-procedure
3338 ((glConvolutionFilter1D
3340 (internalformat GLenum)
3347 "Define a one-dimensional convolution filter.
3350 Must be `GL_CONVOLUTION_1D'.
3353 The internal format of the convolution filter kernel. The allowable
3354 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3355 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3356 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3357 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3358 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3359 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3360 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3361 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3362 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3363 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3364 `GL_RGBA12', or `GL_RGBA16'.
3367 The width of the pixel array referenced by DATA.
3370 The format of the pixel data in DATA. The allowable values are
3371 `GL_ALPHA', `GL_LUMINANCE', `GL_LUMINANCE_ALPHA', `GL_INTENSITY',
3372 `GL_RGB', and `GL_RGBA'.
3375 The type of the pixel data in DATA. Symbolic constants
3376 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3377 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3378 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3379 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3380 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3381 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3382 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3383 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3387 Pointer to a one-dimensional array of pixel data that is processed
3388 to build the convolution filter kernel.
3390 `glConvolutionFilter1D' builds a one-dimensional convolution filter
3391 kernel from an array of pixels.
3393 The pixel array specified by WIDTH, FORMAT, TYPE, and DATA is extracted
3394 from memory and processed just as if `glDrawPixels' were called, but
3395 processing stops after the final expansion to RGBA is completed.
3397 If a non-zero named buffer object is bound to the
3398 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3399 filter is specified, DATA is treated as a byte offset into the buffer
3400 object's data store.
3402 The R, G, B, and A components of each pixel are next scaled by the four
3403 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 1D
3404 `GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3405 are set by `glConvolutionParameter' using the `GL_CONVOLUTION_1D' target
3406 and the names `GL_CONVOLUTION_FILTER_SCALE' and
3407 `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3408 four values that are applied to red, green, blue, and alpha, in that
3409 order.) The R, G, B, and A values are not clamped to [0,1] at any time
3410 during this process.
3412 Each pixel is then converted to the internal format specified by
3413 INTERNALFORMAT. This conversion simply maps the component values of the
3414 pixel (R, G, B, and A) to the values included in the internal format
3415 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3421 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3429 `GL_LUMINANCE_ALPHA'
3441 The red, green, blue, alpha, luminance, and/or intensity components of
3442 the resulting pixels are stored in floating-point rather than integer
3443 format. They form a one-dimensional filter kernel image indexed with
3444 coordinate I such that I starts at 0 and increases from left to right.
3445 Kernel location I is derived from the Ith pixel, counting from 0.
3447 Note that after a convolution is performed, the resulting color
3448 components are also scaled by their corresponding
3449 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3450 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3451 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3452 set by `glPixelTransfer'.
3454 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
3456 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3459 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3462 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3465 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3466 than the maximum supported value. This value may be queried with
3467 `glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
3468 `GL_MAX_CONVOLUTION_WIDTH'.
3470 `GL_INVALID_OPERATION' is generated if FORMAT is one of
3471 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3472 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and TYPE is
3475 `GL_INVALID_OPERATION' is generated if FORMAT is one of
3476 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3477 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3478 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3479 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3480 TYPE is neither `GL_RGBA' nor `GL_BGRA'.
3482 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3483 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3484 data store is currently mapped.
3486 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3487 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3488 unpacked from the buffer object such that the memory reads required
3489 would exceed the data store size.
3491 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3492 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3493 divisible into the number of bytes needed to store in memory a datum
3496 `GL_INVALID_OPERATION' is generated if `glConvolutionFilter1D' is
3497 executed between the execution of `glBegin' and the corresponding
3498 execution of `glEnd'.")
3500 (define-gl-procedure
3501 ((glConvolutionFilter2D
3503 (internalformat GLenum)
3511 "Define a two-dimensional convolution filter.
3514 Must be `GL_CONVOLUTION_2D'.
3517 The internal format of the convolution filter kernel. The allowable
3518 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3519 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3520 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3521 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3522 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3523 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3524 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3525 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3526 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3527 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3528 `GL_RGBA12', or `GL_RGBA16'.
3531 The width of the pixel array referenced by DATA.
3534 The height of the pixel array referenced by DATA.
3537 The format of the pixel data in DATA. The allowable values are
3538 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
3539 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
3542 The type of the pixel data in DATA. Symbolic constants
3543 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3544 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3545 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3546 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3547 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3548 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3549 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3550 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3554 Pointer to a two-dimensional array of pixel data that is processed
3555 to build the convolution filter kernel.
3557 `glConvolutionFilter2D' builds a two-dimensional convolution filter
3558 kernel from an array of pixels.
3560 The pixel array specified by WIDTH, HEIGHT, FORMAT, TYPE, and DATA is
3561 extracted from memory and processed just as if `glDrawPixels' were
3562 called, but processing stops after the final expansion to RGBA is
3565 If a non-zero named buffer object is bound to the
3566 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3567 filter is specified, DATA is treated as a byte offset into the buffer
3568 object's data store.
3570 The R, G, B, and A components of each pixel are next scaled by the four
3571 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 2D
3572 `GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3573 are set by `glConvolutionParameter' using the `GL_CONVOLUTION_2D' target
3574 and the names `GL_CONVOLUTION_FILTER_SCALE' and
3575 `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3576 four values that are applied to red, green, blue, and alpha, in that
3577 order.) The R, G, B, and A values are not clamped to [0,1] at any time
3578 during this process.
3580 Each pixel is then converted to the internal format specified by
3581 INTERNALFORMAT. This conversion simply maps the component values of the
3582 pixel (R, G, B, and A) to the values included in the internal format
3583 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3589 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3597 `GL_LUMINANCE_ALPHA'
3609 The red, green, blue, alpha, luminance, and/or intensity components of
3610 the resulting pixels are stored in floating-point rather than integer
3611 format. They form a two-dimensional filter kernel image indexed with
3612 coordinates I and J such that I starts at zero and increases from left
3613 to right, and J starts at zero and increases from bottom to top. Kernel
3614 location I,J is derived from the Nth pixel, where N is I+J*WIDTH.
3616 Note that after a convolution is performed, the resulting color
3617 components are also scaled by their corresponding
3618 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3619 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3620 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3621 set by `glPixelTransfer'.
3623 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
3625 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3628 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3631 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3634 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3635 than the maximum supported value. This value may be queried with
3636 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3637 `GL_MAX_CONVOLUTION_WIDTH'.
3639 `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
3640 than the maximum supported value. This value may be queried with
3641 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3642 `GL_MAX_CONVOLUTION_HEIGHT'.
3644 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
3645 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3646 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
3649 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
3650 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3651 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3652 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3653 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3654 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
3656 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3657 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3658 data store is currently mapped.
3660 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3661 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3662 unpacked from the buffer object such that the memory reads required
3663 would exceed the data store size.
3665 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3666 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3667 divisible into the number of bytes needed to store in memory a datum
3670 `GL_INVALID_OPERATION' is generated if `glConvolutionFilter2D' is
3671 executed between the execution of `glBegin' and the corresponding
3672 execution of `glEnd'.")
3674 (define-gl-procedure
3675 ((glConvolutionParameterf
3681 (glConvolutionParameteri
3687 "Set convolution parameters.
3690 The target for the convolution parameter. Must be one of
3691 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D'.
3694 The parameter to be set. Must be `GL_CONVOLUTION_BORDER_MODE'.
3697 The parameter value. Must be one of `GL_REDUCE',
3698 `GL_CONSTANT_BORDER', `GL_REPLICATE_BORDER'.
3702 `glConvolutionParameter' sets the value of a convolution parameter.
3704 TARGET selects the convolution filter to be affected:
3705 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D' for the
3706 1D, 2D, or separable 2D filter, respectively.
3708 PNAME selects the parameter to be changed. `GL_CONVOLUTION_FILTER_SCALE'
3709 and `GL_CONVOLUTION_FILTER_BIAS' affect the definition of the
3710 convolution filter kernel; see `glConvolutionFilter1D',
3711 `glConvolutionFilter2D', and `glSeparableFilter2D' for details. In these
3712 cases, PARAMSv is an array of four values to be applied to red, green,
3713 blue, and alpha values, respectively. The initial value for
3714 `GL_CONVOLUTION_FILTER_SCALE' is (1, 1, 1, 1), and the initial value for
3715 `GL_CONVOLUTION_FILTER_BIAS' is (0, 0, 0, 0).
3717 A PNAME value of `GL_CONVOLUTION_BORDER_MODE' controls the convolution
3718 border mode. The accepted modes are:
3721 The image resulting from convolution is smaller than the source
3722 image. If the filter width is WF and height is HF , and the source
3723 image width is WS and height is HS , then the convolved image width
3724 will be WS-WF+1 and height will be HS-HF+1 . (If this reduction
3725 would generate an image with zero or negative width and/or height,
3726 the output is simply null, with no error generated.) The
3727 coordinates of the image resulting from convolution are zero
3728 through WS-WF in width and zero through HS-HF in height.
3730 `GL_CONSTANT_BORDER'
3731 The image resulting from convolution is the same size as the source
3732 image, and processed as if the source image were surrounded by
3733 pixels with their color specified by the
3734 `GL_CONVOLUTION_BORDER_COLOR'.
3736 `GL_REPLICATE_BORDER'
3737 The image resulting from convolution is the same size as the source
3738 image, and processed as if the outermost pixel on the border of the
3739 source image were replicated.
3741 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
3744 `GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
3747 `GL_INVALID_ENUM' is generated if PNAME is `GL_CONVOLUTION_BORDER_MODE'
3748 and PARAMS is not one of `GL_REDUCE', `GL_CONSTANT_BORDER', or
3749 `GL_REPLICATE_BORDER'.
3751 `GL_INVALID_OPERATION' is generated if `glConvolutionParameter' is
3752 executed between the execution of `glBegin' and the corresponding
3753 execution of `glEnd'.")
3755 (define-gl-procedure
3756 ((glCopyColorSubTable
3764 "Respecify a portion of a color table.
3767 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
3768 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3771 The starting index of the portion of the color table to be
3777 The window coordinates of the left corner of the row of pixels to
3781 The number of table entries to replace.
3783 `glCopyColorSubTable' is used to respecify a contiguous portion of a
3784 color table previously defined using `glColorTable'. The pixels copied
3785 from the framebuffer replace the portion of the existing table from
3786 indices START to START+X-1 , inclusive. This region may not include any
3787 entries outside the range of the color table, as was originally
3788 specified. It is not an error to specify a subtexture with width of 0,
3789 but such a specification has no effect.
3791 `GL_INVALID_VALUE' is generated if TARGET is not a previously defined
3794 `GL_INVALID_VALUE' is generated if TARGET is not one of the allowable
3797 `GL_INVALID_VALUE' is generated if START+X>WIDTH .
3799 `GL_INVALID_OPERATION' is generated if `glCopyColorSubTable' is executed
3800 between the execution of `glBegin' and the corresponding execution of
3803 (define-gl-procedure
3806 (internalformat GLenum)
3812 "Copy pixels into a color table.
3815 The color table target. Must be `GL_COLOR_TABLE',
3816 `GL_POST_CONVOLUTION_COLOR_TABLE', or
3817 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3820 The internal storage format of the texture image. Must be one of
3821 the following symbolic constants: `GL_ALPHA', `GL_ALPHA4',
3822 `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', `GL_LUMINANCE',
3823 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
3824 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
3825 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
3826 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
3827 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
3828 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
3829 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
3830 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
3831 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
3834 The x coordinate of the lower-left corner of the pixel rectangle to
3835 be transferred to the color table.
3838 The y coordinate of the lower-left corner of the pixel rectangle to
3839 be transferred to the color table.
3842 The width of the pixel rectangle.
3844 `glCopyColorTable' loads a color table with pixels from the current
3845 `GL_READ_BUFFER' (rather than from main memory, as is the case for
3848 The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y)
3849 having width WIDTH and height 1 is loaded into the color table. If any
3850 pixels within this region are outside the window that is associated with
3851 the GL context, the values obtained for those pixels are undefined.
3853 The pixels in the rectangle are processed just as if `glReadPixels' were
3854 called, with INTERNALFORMAT set to RGBA, but processing stops after the
3855 final conversion to RGBA.
3857 The four scale parameters and the four bias parameters that are defined
3858 for the table are then used to scale and bias the R, G, B, and A
3859 components of each pixel. The scale and bias parameters are set by
3860 calling `glColorTableParameter'.
3862 Next, the R, G, B, and A values are clamped to the range [0,1] . Each
3863 pixel is then converted to the internal format specified by
3864 INTERNALFORMAT. This conversion simply maps the component values of the
3865 pixel (R, G, B, and A) to the values included in the internal format
3866 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3872 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3880 `GL_LUMINANCE_ALPHA'
3892 Finally, the red, green, blue, alpha, luminance, and/or intensity
3893 components of the resulting pixels are stored in the color table. They
3894 form a one-dimensional table with indices in the range [0,WIDTH-1] .
3898 `GL_INVALID_ENUM' is generated when TARGET is not one of the allowable
3901 `GL_INVALID_VALUE' is generated if WIDTH is less than zero.
3903 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not one of the
3906 `GL_TABLE_TOO_LARGE' is generated if the requested color table is too
3907 large to be supported by the implementation.
3909 `GL_INVALID_OPERATION' is generated if `glCopyColorTable' is executed
3910 between the execution of `glBegin' and the corresponding execution of
3913 (define-gl-procedure
3914 ((glCopyConvolutionFilter1D
3916 (internalformat GLenum)
3922 "Copy pixels into a one-dimensional convolution filter.
3925 Must be `GL_CONVOLUTION_1D'.
3928 The internal format of the convolution filter kernel. The allowable
3929 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3930 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3931 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3932 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3933 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3934 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3935 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3936 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3937 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3938 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3939 `GL_RGBA12', or `GL_RGBA16'.
3944 The window space coordinates of the lower-left coordinate of the
3945 pixel array to copy.
3948 The width of the pixel array to copy.
3950 `glCopyConvolutionFilter1D' defines a one-dimensional convolution filter
3951 kernel with pixels from the current `GL_READ_BUFFER' (rather than from
3952 main memory, as is the case for `glConvolutionFilter1D').
3954 The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
3955 width WIDTH and height 1 is used to define the convolution filter. If
3956 any pixels within this region are outside the window that is associated
3957 with the GL context, the values obtained for those pixels are undefined.
3959 The pixels in the rectangle are processed exactly as if `glReadPixels'
3960 had been called with FORMAT set to RGBA, but the process stops just
3961 before final conversion. The R, G, B, and A components of each pixel are
3962 next scaled by the four 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and
3963 biased by the four 1D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
3964 scale and bias parameters are set by `glConvolutionParameter' using the
3965 `GL_CONVOLUTION_1D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
3966 and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
3967 of four values that are applied to red, green, blue, and alpha, in that
3968 order.) The R, G, B, and A values are not clamped to [0,1] at any time
3969 during this process.
3971 Each pixel is then converted to the internal format specified by
3972 INTERNALFORMAT. This conversion simply maps the component values of the
3973 pixel (R, G, B, and A) to the values included in the internal format
3974 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3980 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3988 `GL_LUMINANCE_ALPHA'
4000 The red, green, blue, alpha, luminance, and/or intensity components of
4001 the resulting pixels are stored in floating-point rather than integer
4004 Pixel ordering is such that lower x screen coordinates correspond to
4005 lower I filter image coordinates.
4007 Note that after a convolution is performed, the resulting color
4008 components are also scaled by their corresponding
4009 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4010 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4011 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4012 set by `glPixelTransfer'.
4014 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
4016 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4019 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4020 than the maximum supported value. This value may be queried with
4021 `glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
4022 `GL_MAX_CONVOLUTION_WIDTH'.
4024 `GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter1D' is
4025 executed between the execution of `glBegin' and the corresponding
4026 execution of `glEnd'.")
4028 (define-gl-procedure
4029 ((glCopyConvolutionFilter2D
4031 (internalformat GLenum)
4038 "Copy pixels into a two-dimensional convolution filter.
4041 Must be `GL_CONVOLUTION_2D'.
4044 The internal format of the convolution filter kernel. The allowable
4045 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
4046 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
4047 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
4048 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
4049 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
4050 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
4051 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
4052 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
4053 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
4054 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
4055 `GL_RGBA12', or `GL_RGBA16'.
4060 The window space coordinates of the lower-left coordinate of the
4061 pixel array to copy.
4064 The width of the pixel array to copy.
4067 The height of the pixel array to copy.
4069 `glCopyConvolutionFilter2D' defines a two-dimensional convolution filter
4070 kernel with pixels from the current `GL_READ_BUFFER' (rather than from
4071 main memory, as is the case for `glConvolutionFilter2D').
4073 The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
4074 width WIDTH and height HEIGHT is used to define the convolution filter.
4075 If any pixels within this region are outside the window that is
4076 associated with the GL context, the values obtained for those pixels are
4079 The pixels in the rectangle are processed exactly as if `glReadPixels'
4080 had been called with FORMAT set to RGBA, but the process stops just
4081 before final conversion. The R, G, B, and A components of each pixel are
4082 next scaled by the four 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and
4083 biased by the four 2D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
4084 scale and bias parameters are set by `glConvolutionParameter' using the
4085 `GL_CONVOLUTION_2D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
4086 and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
4087 of four values that are applied to red, green, blue, and alpha, in that
4088 order.) The R, G, B, and A values are not clamped to [0,1] at any time
4089 during this process.
4091 Each pixel is then converted to the internal format specified by
4092 INTERNALFORMAT. This conversion simply maps the component values of the
4093 pixel (R, G, B, and A) to the values included in the internal format
4094 (red, green, blue, alpha, luminance, and intensity). The mapping is as
4100 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4108 `GL_LUMINANCE_ALPHA'
4120 The red, green, blue, alpha, luminance, and/or intensity components of
4121 the resulting pixels are stored in floating-point rather than integer
4124 Pixel ordering is such that lower x screen coordinates correspond to
4125 lower I filter image coordinates, and lower y screen coordinates
4126 correspond to lower J filter image coordinates.
4128 Note that after a convolution is performed, the resulting color
4129 components are also scaled by their corresponding
4130 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4131 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4132 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4133 set by `glPixelTransfer'.
4135 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
4137 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4140 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4141 than the maximum supported value. This value may be queried with
4142 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4143 `GL_MAX_CONVOLUTION_WIDTH'.
4145 `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
4146 than the maximum supported value. This value may be queried with
4147 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4148 `GL_MAX_CONVOLUTION_HEIGHT'.
4150 `GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter2D' is
4151 executed between the execution of `glBegin' and the corresponding
4152 execution of `glEnd'.")
4154 (define-gl-procedure
4163 "Copy pixels in the frame buffer.
4168 Specify the window coordinates of the lower left corner of the
4169 rectangular region of pixels to be copied.
4174 Specify the dimensions of the rectangular region of pixels to be
4175 copied. Both must be nonnegative.
4178 Specifies whether color values, depth values, or stencil values are
4179 to be copied. Symbolic constants `GL_COLOR', `GL_DEPTH', and
4180 `GL_STENCIL' are accepted.
4182 `glCopyPixels' copies a screen-aligned rectangle of pixels from the
4183 specified frame buffer location to a region relative to the current
4184 raster position. Its operation is well defined only if the entire pixel
4185 source region is within the exposed portion of the window. Results of
4186 copies from outside the window, or from regions of the window that are
4187 not exposed, are hardware dependent and undefined.
4189 X and Y specify the window coordinates of the lower left corner of the
4190 rectangular region to be copied. WIDTH and HEIGHT specify the dimensions
4191 of the rectangular region to be copied. Both WIDTH and HEIGHT must not
4194 Several parameters control the processing of the pixel data while it is
4195 being copied. These parameters are set with three commands:
4196 `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This reference page
4197 describes the effects on `glCopyPixels' of most, but not all, of the
4198 parameters specified by these three commands.
4200 `glCopyPixels' copies values from each pixel with the lower left-hand
4201 corner at (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said
4202 to be the I th pixel in the J th row. Pixels are copied in row order
4203 from the lowest to the highest row, left to right in each row.
4205 TYPE specifies whether color, depth, or stencil data is to be copied.
4206 The details of the transfer for each data type are as follows:
4209 Indices or RGBA colors are read from the buffer currently specified
4210 as the read source buffer (see `glReadBuffer'). If the GL is in
4211 color index mode, each index that is read from this buffer is
4212 converted to a fixed-point format with an unspecified number of
4213 bits to the right of the binary point. Each index is then shifted
4214 left by `GL_INDEX_SHIFT' bits, and added to `GL_INDEX_OFFSET'. If
4215 `GL_INDEX_SHIFT' is negative, the shift is to the right. In either
4216 case, zero bits fill otherwise unspecified bit locations in the
4217 result. If `GL_MAP_COLOR' is true, the index is replaced with the
4218 value that it references in lookup table `GL_PIXEL_MAP_I_TO_I'.
4219 Whether the lookup replacement of the index is done or not, the
4220 integer part of the index is then ANDed with 2^B-1 , where B is the
4221 number of bits in a color index buffer.
4223 If the GL is in RGBA mode, the red, green, blue, and alpha
4224 components of each pixel that is read are converted to an internal
4225 floating-point format with unspecified precision. The conversion
4226 maps the largest representable component value to 1.0, and
4227 component value 0 to 0.0. The resulting floating-point color values
4228 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
4229 C is RED, GREEN, BLUE, and ALPHA for the respective color
4230 components. The results are clamped to the range [0,1]. If
4231 `GL_MAP_COLOR' is true, each color component is scaled by the size
4232 of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the value
4233 that it references in that table. C is R, G, B, or A.
4235 If the `ARB_imaging' extension is supported, the color values may
4236 be additionally processed by color-table lookups, color-matrix
4237 transformations, and convolution filters.
4239 The GL then converts the resulting indices or RGBA colors to
4240 fragments by attaching the current raster position Z coordinate and
4241 texture coordinates to each pixel, then assigning window
4242 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4243 position, and the pixel was the I th pixel in the J th row. These
4244 pixel fragments are then treated just like the fragments generated
4245 by rasterizing points, lines, or polygons. Texture mapping, fog,
4246 and all the fragment operations are applied before the fragments
4247 are written to the frame buffer.
4250 Depth values are read from the depth buffer and converted directly
4251 to an internal floating-point format with unspecified precision.
4252 The resulting floating-point depth value is then multiplied by
4253 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
4254 clamped to the range [0,1].
4256 The GL then converts the resulting depth components to fragments by
4257 attaching the current raster position color or color index and
4258 texture coordinates to each pixel, then assigning window
4259 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4260 position, and the pixel was the I th pixel in the J th row. These
4261 pixel fragments are then treated just like the fragments generated
4262 by rasterizing points, lines, or polygons. Texture mapping, fog,
4263 and all the fragment operations are applied before the fragments
4264 are written to the frame buffer.
4267 Stencil indices are read from the stencil buffer and converted to
4268 an internal fixed-point format with an unspecified number of bits
4269 to the right of the binary point. Each fixed-point index is then
4270 shifted left by `GL_INDEX_SHIFT' bits, and added to
4271 `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is negative, the shift is to
4272 the right. In either case, zero bits fill otherwise unspecified bit
4273 locations in the result. If `GL_MAP_STENCIL' is true, the index is
4274 replaced with the value that it references in lookup table
4275 `GL_PIXEL_MAP_S_TO_S'. Whether the lookup replacement of the index
4276 is done or not, the integer part of the index is then ANDed with
4277 2^B-1 , where B is the number of bits in the stencil buffer. The
4278 resulting stencil indices are then written to the stencil buffer
4279 such that the index read from the I th location of the J th row is
4280 written to location (X_R+I,Y_R+J) , where (X_R,Y_R) is the current
4281 raster position. Only the pixel ownership test, the scissor test,
4282 and the stencil writemask affect these write operations.
4284 The rasterization described thus far assumes pixel zoom factors of 1.0.
4285 If `glPixelZoom' is used to change the X and Y pixel zoom factors,
4286 pixels are converted to fragments as follows. If (X_R,Y_R) is the
4287 current raster position, and a given pixel is in the I th location in
4288 the J th row of the source pixel rectangle, then fragments are generated
4289 for pixels whose centers are in the rectangle with corners at
4291 (X_R+ZOOM_X,\u2062I,Y_R+ZOOM_Y,\u2062J)
4295 (X_R+ZOOM_X,\u2061(I+1,),Y_R+ZOOM_Y,\u2061(J+1,))
4297 where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
4300 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
4302 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
4304 `GL_INVALID_OPERATION' is generated if TYPE is `GL_DEPTH' and there is
4307 `GL_INVALID_OPERATION' is generated if TYPE is `GL_STENCIL' and there is
4310 `GL_INVALID_OPERATION' is generated if `glCopyPixels' is executed
4311 between the execution of `glBegin' and the corresponding execution of
4314 (define-gl-procedure
4318 (internalformat GLenum)
4325 "Copy pixels into a 1D texture image.
4328 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4331 Specifies the level-of-detail number. Level 0 is the base image
4332 level. Level N is the Nth mipmap reduction image.
4335 Specifies the internal format of the texture. Must be one of the
4336 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4337 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4338 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4339 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4340 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4341 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4342 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4343 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4344 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4345 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4346 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4347 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4348 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4349 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4350 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4351 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4352 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4358 Specify the window coordinates of the left corner of the row of
4359 pixels to be copied.
4362 Specifies the width of the texture image. Must be 0 or
4363 2^N+2\u2061(BORDER,) for some integer N . The height of the texture
4367 Specifies the width of the border. Must be either 0 or 1.
4369 `glCopyTexImage1D' defines a one-dimensional texture image with pixels
4370 from the current `GL_READ_BUFFER'.
4372 The screen-aligned pixel row with left corner at (X,Y) and with a length
4373 of WIDTH+2\u2061(BORDER,) defines the texture array at the mipmap level
4374 specified by LEVEL. INTERNALFORMAT specifies the internal format of the
4377 The pixels in the row are processed exactly as if `glCopyPixels' had
4378 been called, but the process stops just before final conversion. At this
4379 point all pixel component values are clamped to the range [0,1] and then
4380 converted to the texture's internal format for storage in the texel
4383 Pixel ordering is such that lower X screen coordinates correspond to
4384 lower texture coordinates.
4386 If any of the pixels within the specified row of the current
4387 `GL_READ_BUFFER' are outside the window associated with the current
4388 rendering context, then the values obtained for those pixels are
4391 `glCopyTexImage1D' defines a one-dimensional texture image with pixels
4392 from the current `GL_READ_BUFFER'.
4394 When INTERNALFORMAT is one of the sRGB types, the GL does not
4395 automatically convert the source pixels to the sRGB color space. In this
4396 case, the `glPixelMap' function can be used to accomplish the
4399 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
4402 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4404 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4405 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4407 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an allowable
4410 `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
4411 2 + `GL_MAX_TEXTURE_SIZE'.
4413 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4414 supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
4415 some integer value of N.
4417 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4419 `GL_INVALID_OPERATION' is generated if `glCopyTexImage1D' is executed
4420 between the execution of `glBegin' and the corresponding execution of
4423 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4424 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4425 `GL_DEPTH_COMPONENT32' and there is no depth buffer.")
4427 (define-gl-procedure
4431 (internalformat GLenum)
4439 "Copy pixels into a 2D texture image.
4442 Specifies the target texture. Must be `GL_TEXTURE_2D',
4443 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4444 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4445 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4446 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4449 Specifies the level-of-detail number. Level 0 is the base image
4450 level. Level N is the Nth mipmap reduction image.
4453 Specifies the internal format of the texture. Must be one of the
4454 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4455 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4456 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4457 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4458 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4459 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4460 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4461 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4462 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4463 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4464 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4465 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4466 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4467 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4468 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4469 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4470 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4476 Specify the window coordinates of the lower left corner of the
4477 rectangular region of pixels to be copied.
4480 Specifies the width of the texture image. Must be 0 or
4481 2^N+2\u2061(BORDER,) for some integer N .
4484 Specifies the height of the texture image. Must be 0 or
4485 2^M+2\u2061(BORDER,) for some integer M .
4488 Specifies the width of the border. Must be either 0 or 1.
4490 `glCopyTexImage2D' defines a two-dimensional texture image, or cube-map
4491 texture image with pixels from the current `GL_READ_BUFFER'.
4493 The screen-aligned pixel rectangle with lower left corner at (X, Y) and
4494 with a width of WIDTH+2\u2061(BORDER,) and a height of HEIGHT+2\u2061(BORDER,)
4495 defines the texture array at the mipmap level specified by LEVEL.
4496 INTERNALFORMAT specifies the internal format of the texture array.
4498 The pixels in the rectangle are processed exactly as if `glCopyPixels'
4499 had been called, but the process stops just before final conversion. At
4500 this point all pixel component values are clamped to the range [0,1] and
4501 then converted to the texture's internal format for storage in the texel
4504 Pixel ordering is such that lower X and Y screen coordinates correspond
4505 to lower S and T texture coordinates.
4507 If any of the pixels within the specified rectangle of the current
4508 `GL_READ_BUFFER' are outside the window associated with the current
4509 rendering context, then the values obtained for those pixels are
4512 When INTERNALFORMAT is one of the sRGB types, the GL does not
4513 automatically convert the source pixels to the sRGB color space. In this
4514 case, the `glPixelMap' function can be used to accomplish the
4517 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4518 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4519 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4520 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4522 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4524 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4525 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4527 `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
4528 2 + `GL_MAX_TEXTURE_SIZE'.
4530 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4531 supported and the WIDTH or DEPTH cannot be represented as
4532 2^K+2\u2061(BORDER,) for some integer K .
4534 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4536 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an accepted
4539 `GL_INVALID_OPERATION' is generated if `glCopyTexImage2D' is executed
4540 between the execution of `glBegin' and the corresponding execution of
4543 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4544 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4545 `GL_DEPTH_COMPONENT32' and there is no depth buffer.")
4547 (define-gl-procedure
4548 ((glCopyTexSubImage1D
4557 "Copy a one-dimensional texture subimage.
4560 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4563 Specifies the level-of-detail number. Level 0 is the base image
4564 level. Level N is the Nth mipmap reduction image.
4567 Specifies the texel offset within the texture array.
4572 Specify the window coordinates of the left corner of the row of
4573 pixels to be copied.
4576 Specifies the width of the texture subimage.
4578 `glCopyTexSubImage1D' replaces a portion of a one-dimensional texture
4579 image with pixels from the current `GL_READ_BUFFER' (rather than from
4580 main memory, as is the case for `glTexSubImage1D').
4582 The screen-aligned pixel row with left corner at (X,\\ Y), and with
4583 length WIDTH replaces the portion of the texture array with x indices
4584 XOFFSET through XOFFSET+WIDTH-1 , inclusive. The destination in the
4585 texture array may not include any texels outside the texture array as it
4586 was originally specified.
4588 The pixels in the row are processed exactly as if `glCopyPixels' had
4589 been called, but the process stops just before final conversion. At this
4590 point, all pixel component values are clamped to the range [0,1] and
4591 then converted to the texture's internal format for storage in the texel
4594 It is not an error to specify a subtexture with zero width, but such a
4595 specification has no effect. If any of the pixels within the specified
4596 row of the current `GL_READ_BUFFER' are outside the read window
4597 associated with the current rendering context, then the values obtained
4598 for those pixels are undefined.
4600 No change is made to the INTERNALFORMAT, WIDTH, or BORDER parameters of
4601 the specified texture array or to texel values outside the specified
4604 `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_1D'.
4606 `GL_INVALID_OPERATION' is generated if the texture array has not been
4607 defined by a previous `glTexImage1D' or `glCopyTexImage1D' operation.
4609 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4611 `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4612 the returned value of `GL_MAX_TEXTURE_SIZE'.
4614 `GL_INVALID_VALUE' is generated if XOFFSET<-B , or
4615 (XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH' and B is the
4616 `GL_TEXTURE_BORDER' of the texture image being modified. Note that W
4617 includes twice the border width.")
4619 (define-gl-procedure
4620 ((glCopyTexSubImage2D
4631 "Copy a two-dimensional texture subimage.
4634 Specifies the target texture. Must be `GL_TEXTURE_2D',
4635 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4636 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4637 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4638 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4641 Specifies the level-of-detail number. Level 0 is the base image
4642 level. Level N is the Nth mipmap reduction image.
4645 Specifies a texel offset in the x direction within the texture
4649 Specifies a texel offset in the y direction within the texture
4655 Specify the window coordinates of the lower left corner of the
4656 rectangular region of pixels to be copied.
4659 Specifies the width of the texture subimage.
4662 Specifies the height of the texture subimage.
4664 `glCopyTexSubImage2D' replaces a rectangular portion of a
4665 two-dimensional texture image or cube-map texture image with pixels from
4666 the current `GL_READ_BUFFER' (rather than from main memory, as is the
4667 case for `glTexSubImage2D').
4669 The screen-aligned pixel rectangle with lower left corner at (X,Y) and
4670 with width WIDTH and height HEIGHT replaces the portion of the texture
4671 array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4672 indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at the mipmap
4673 level specified by LEVEL.
4675 The pixels in the rectangle are processed exactly as if `glCopyPixels'
4676 had been called, but the process stops just before final conversion. At
4677 this point, all pixel component values are clamped to the range [0,1]
4678 and then converted to the texture's internal format for storage in the
4681 The destination rectangle in the texture array may not include any
4682 texels outside the texture array as it was originally specified. It is
4683 not an error to specify a subtexture with zero width or height, but such
4684 a specification has no effect.
4686 If any of the pixels within the specified rectangle of the current
4687 `GL_READ_BUFFER' are outside the read window associated with the current
4688 rendering context, then the values obtained for those pixels are
4691 No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, or BORDER
4692 parameters of the specified texture array or to texel values outside the
4693 specified subregion.
4695 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4696 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4697 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4698 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4700 `GL_INVALID_OPERATION' is generated if the texture array has not been
4701 defined by a previous `glTexImage2D' or `glCopyTexImage2D' operation.
4703 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4705 `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4706 the returned value of `GL_MAX_TEXTURE_SIZE'.
4708 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4709 , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
4710 `GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the
4711 `GL_TEXTURE_BORDER' of the texture image being modified. Note that W and
4712 H include twice the border width.
4714 `GL_INVALID_OPERATION' is generated if `glCopyTexSubImage2D' is executed
4715 between the execution of `glBegin' and the corresponding execution of
4718 (define-gl-procedure
4719 ((glCopyTexSubImage3D
4731 "Copy a three-dimensional texture subimage.
4734 Specifies the target texture. Must be `GL_TEXTURE_3D'
4737 Specifies the level-of-detail number. Level 0 is the base image
4738 level. Level N is the Nth mipmap reduction image.
4741 Specifies a texel offset in the x direction within the texture
4745 Specifies a texel offset in the y direction within the texture
4749 Specifies a texel offset in the z direction within the texture
4755 Specify the window coordinates of the lower left corner of the
4756 rectangular region of pixels to be copied.
4759 Specifies the width of the texture subimage.
4762 Specifies the height of the texture subimage.
4764 `glCopyTexSubImage3D' replaces a rectangular portion of a
4765 three-dimensional texture image with pixels from the current
4766 `GL_READ_BUFFER' (rather than from main memory, as is the case for
4769 The screen-aligned pixel rectangle with lower left corner at (X,\\ Y) and
4770 with width WIDTH and height HEIGHT replaces the portion of the texture
4771 array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4772 indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at z index ZOFFSET
4773 and at the mipmap level specified by LEVEL.
4775 The pixels in the rectangle are processed exactly as if `glCopyPixels'
4776 had been called, but the process stops just before final conversion. At
4777 this point, all pixel component values are clamped to the range [0,1]
4778 and then converted to the texture's internal format for storage in the
4781 The destination rectangle in the texture array may not include any
4782 texels outside the texture array as it was originally specified. It is
4783 not an error to specify a subtexture with zero width or height, but such
4784 a specification has no effect.
4786 If any of the pixels within the specified rectangle of the current
4787 `GL_READ_BUFFER' are outside the read window associated with the current
4788 rendering context, then the values obtained for those pixels are
4791 No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, DEPTH, or BORDER
4792 parameters of the specified texture array or to texel values outside the
4793 specified subregion.
4795 `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
4797 `GL_INVALID_OPERATION' is generated if the texture array has not been
4798 defined by a previous `glTexImage3D' operation.
4800 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4802 `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4803 the returned value of `GL_MAX_3D_TEXTURE_SIZE'.
4805 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4806 , YOFFSET<-B , (YOFFSET+HEIGHT,)>(H-B,) , ZOFFSET<-B , or
4807 (ZOFFSET+1,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
4808 `GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH', and B is the
4809 `GL_TEXTURE_BORDER' of the texture image being modified. Note that W , H
4810 , and D include twice the border width.
4812 `GL_INVALID_OPERATION' is generated if `glCopyTexSubImage3D' is executed
4813 between the execution of `glBegin' and the corresponding execution of
4816 (define-gl-procedure
4817 ((glCreateProgram -> GLuint))
4818 "Creates a program object.
4820 `glCreateProgram' creates an empty program object and returns a non-zero
4821 value by which it can be referenced. A program object is an object to
4822 which shader objects can be attached. This provides a mechanism to
4823 specify the shader objects that will be linked to create a program. It
4824 also provides a means for checking the compatibility of the shaders that
4825 will be used to create a program (for instance, checking the
4826 compatibility between a vertex shader and a fragment shader). When no
4827 longer needed as part of a program object, shader objects can be
4830 One or more executables are created in a program object by successfully
4831 attaching shader objects to it with `glAttachShader', successfully
4832 compiling the shader objects with `glCompileShader', and successfully
4833 linking the program object with `glLinkProgram'. These executables are
4834 made part of current state when `glUseProgram' is called. Program
4835 objects can be deleted by calling `glDeleteProgram'. The memory
4836 associated with the program object will be deleted when it is no longer
4837 part of current rendering state for any context.
4839 This function returns 0 if an error occurs creating the program object.
4841 `GL_INVALID_OPERATION' is generated if `glCreateProgram' is executed
4842 between the execution of `glBegin' and the corresponding execution of
4845 (define-gl-procedure
4846 ((glCreateShader (shaderType GLenum) -> GLuint))
4847 "Creates a shader object.
4850 Specifies the type of shader to be created. Must be either
4851 `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER'.
4853 `glCreateShader' creates an empty shader object and returns a non-zero
4854 value by which it can be referenced. A shader object is used to maintain
4855 the source code strings that define a shader. SHADERTYPE indicates the
4856 type of shader to be created. Two types of shaders are supported. A
4857 shader of type `GL_VERTEX_SHADER' is a shader that is intended to run on
4858 the programmable vertex processor and replace the fixed functionality
4859 vertex processing in OpenGL. A shader of type `GL_FRAGMENT_SHADER' is a
4860 shader that is intended to run on the programmable fragment processor
4861 and replace the fixed functionality fragment processing in OpenGL.
4863 When created, a shader object's `GL_SHADER_TYPE' parameter is set to
4864 either `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER', depending on the
4865 value of SHADERTYPE.
4867 This function returns 0 if an error occurs creating the shader object.
4869 `GL_INVALID_ENUM' is generated if SHADERTYPE is not an accepted value.
4871 `GL_INVALID_OPERATION' is generated if `glCreateShader' is executed
4872 between the execution of `glBegin' and the corresponding execution of
4875 (define-gl-procedure
4876 ((glCullFace (mode GLenum) -> void))
4877 "Specify whether front- or back-facing facets can be culled.
4880 Specifies whether front- or back-facing facets are candidates for
4881 culling. Symbolic constants `GL_FRONT', `GL_BACK', and
4882 `GL_FRONT_AND_BACK' are accepted. The initial value is `GL_BACK'.
4884 `glCullFace' specifies whether front- or back-facing facets are culled
4885 (as specified by MODE) when facet culling is enabled. Facet culling is
4886 initially disabled. To enable and disable facet culling, call the
4887 `glEnable' and `glDisable' commands with the argument `GL_CULL_FACE'.
4888 Facets include triangles, quadrilaterals, polygons, and rectangles.
4890 `glFrontFace' specifies which of the clockwise and counterclockwise
4891 facets are front-facing and back-facing. See `glFrontFace'.
4893 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
4895 `GL_INVALID_OPERATION' is generated if `glCullFace' is executed between
4896 the execution of `glBegin' and the corresponding execution of `glEnd'.")
4898 (define-gl-procedure
4899 ((glDeleteBuffers (n GLsizei) (buffers *) -> void))
4900 "Delete named buffer objects.
4903 Specifies the number of buffer objects to be deleted.
4906 Specifies an array of buffer objects to be deleted.
4908 `glDeleteBuffers' deletes N buffer objects named by the elements of the
4909 array BUFFERS. After a buffer object is deleted, it has no contents, and
4910 its name is free for reuse (for example by `glGenBuffers'). If a buffer
4911 object that is currently bound is deleted, the binding reverts to 0 (the
4912 absence of any buffer object, which reverts to client memory usage).
4914 `glDeleteBuffers' silently ignores 0's and names that do not correspond
4915 to existing buffer objects.
4917 `GL_INVALID_VALUE' is generated if N is negative.
4919 `GL_INVALID_OPERATION' is generated if `glDeleteBuffers' is executed
4920 between the execution of `glBegin' and the corresponding execution of
4923 (define-gl-procedure
4929 "Delete a contiguous group of display lists.
4932 Specifies the integer name of the first display list to delete.
4935 Specifies the number of display lists to delete.
4937 `glDeleteLists' causes a contiguous group of display lists to be
4938 deleted. LIST is the name of the first display list to be deleted, and
4939 RANGE is the number of display lists to delete. All display lists D with
4940 LIST<=D<=LIST+RANGE-1 are deleted.
4942 All storage locations allocated to the specified display lists are
4943 freed, and the names are available for reuse at a later time. Names
4944 within the range that do not have an associated display list are
4945 ignored. If RANGE is 0, nothing happens.
4947 `GL_INVALID_VALUE' is generated if RANGE is negative.
4949 `GL_INVALID_OPERATION' is generated if `glDeleteLists' is executed
4950 between the execution of `glBegin' and the corresponding execution of
4953 (define-gl-procedure
4954 ((glDeleteProgram (program GLuint) -> void))
4955 "Deletes a program object.
4958 Specifies the program object to be deleted.
4960 `glDeleteProgram' frees the memory and invalidates the name associated
4961 with the program object specified by PROGRAM. This command effectively
4962 undoes the effects of a call to `glCreateProgram'.
4964 If a program object is in use as part of current rendering state, it
4965 will be flagged for deletion, but it will not be deleted until it is no
4966 longer part of current state for any rendering context. If a program
4967 object to be deleted has shader objects attached to it, those shader
4968 objects will be automatically detached but not deleted unless they have
4969 already been flagged for deletion by a previous call to
4970 `glDeleteShader'. A value of 0 for PROGRAM will be silently ignored.
4972 To determine whether a program object has been flagged for deletion,
4973 call `glGetProgram' with arguments PROGRAM and `GL_DELETE_STATUS'.
4975 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
4978 `GL_INVALID_OPERATION' is generated if `glDeleteProgram' is executed
4979 between the execution of `glBegin' and the corresponding execution of
4982 (define-gl-procedure
4983 ((glDeleteQueries (n GLsizei) (ids *) -> void))
4984 "Delete named query objects.
4987 Specifies the number of query objects to be deleted.
4990 Specifies an array of query objects to be deleted.
4992 `glDeleteQueries' deletes N query objects named by the elements of the
4993 array IDS. After a query object is deleted, it has no contents, and its
4994 name is free for reuse (for example by `glGenQueries').
4996 `glDeleteQueries' silently ignores 0's and names that do not correspond
4997 to existing query objects.
4999 `GL_INVALID_VALUE' is generated if N is negative.
5001 `GL_INVALID_OPERATION' is generated if `glDeleteQueries' is executed
5002 between the execution of `glBegin' and the corresponding execution of
5005 (define-gl-procedure
5006 ((glDeleteShader (shader GLuint) -> void))
5007 "Deletes a shader object.
5010 Specifies the shader object to be deleted.
5012 `glDeleteShader' frees the memory and invalidates the name associated
5013 with the shader object specified by SHADER. This command effectively
5014 undoes the effects of a call to `glCreateShader'.
5016 If a shader object to be deleted is attached to a program object, it
5017 will be flagged for deletion, but it will not be deleted until it is no
5018 longer attached to any program object, for any rendering context (i.e.,
5019 it must be detached from wherever it was attached before it will be
5020 deleted). A value of 0 for SHADER will be silently ignored.
5022 To determine whether an object has been flagged for deletion, call
5023 `glGetShader' with arguments SHADER and `GL_DELETE_STATUS'.
5025 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
5028 `GL_INVALID_OPERATION' is generated if `glDeleteShader' is executed
5029 between the execution of `glBegin' and the corresponding execution of
5032 (define-gl-procedure
5038 "Delete named textures.
5041 Specifies the number of textures to be deleted.
5044 Specifies an array of textures to be deleted.
5046 `glDeleteTextures' deletes N textures named by the elements of the array
5047 TEXTURES. After a texture is deleted, it has no contents or
5048 dimensionality, and its name is free for reuse (for example by
5049 `glGenTextures'). If a texture that is currently bound is deleted, the
5050 binding reverts to 0 (the default texture).
5052 `glDeleteTextures' silently ignores 0's and names that do not correspond
5053 to existing textures.
5055 `GL_INVALID_VALUE' is generated if N is negative.
5057 `GL_INVALID_OPERATION' is generated if `glDeleteTextures' is executed
5058 between the execution of `glBegin' and the corresponding execution of
5061 (define-gl-procedure
5062 ((glDepthFunc (func GLenum) -> void))
5063 "Specify the value used for depth buffer comparisons.
5066 Specifies the depth comparison function. Symbolic constants
5067 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
5068 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
5069 initial value is `GL_LESS'.
5071 `glDepthFunc' specifies the function used to compare each incoming pixel
5072 depth value with the depth value present in the depth buffer. The
5073 comparison is performed only if depth testing is enabled. (See
5074 `glEnable' and `glDisable' of `GL_DEPTH_TEST'.)
5076 FUNC specifies the conditions under which the pixel will be drawn. The
5077 comparison functions are as follows:
5083 Passes if the incoming depth value is less than the stored depth
5087 Passes if the incoming depth value is equal to the stored depth
5091 Passes if the incoming depth value is less than or equal to the
5095 Passes if the incoming depth value is greater than the stored depth
5099 Passes if the incoming depth value is not equal to the stored depth
5103 Passes if the incoming depth value is greater than or equal to the
5109 The initial value of FUNC is `GL_LESS'. Initially, depth testing is
5110 disabled. If depth testing is disabled or if no depth buffer exists, it
5111 is as if the depth test always passes.
5113 `GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
5115 `GL_INVALID_OPERATION' is generated if `glDepthFunc' is executed between
5116 the execution of `glBegin' and the corresponding execution of `glEnd'.")
5118 (define-gl-procedure
5119 ((glDepthMask (flag GLboolean) -> void))
5120 "Enable or disable writing into the depth buffer.
5123 Specifies whether the depth buffer is enabled for writing. If FLAG
5124 is `GL_FALSE', depth buffer writing is disabled. Otherwise, it is
5125 enabled. Initially, depth buffer writing is enabled.
5127 `glDepthMask' specifies whether the depth buffer is enabled for writing.
5128 If FLAG is `GL_FALSE', depth buffer writing is disabled. Otherwise, it
5129 is enabled. Initially, depth buffer writing is enabled.
5131 `GL_INVALID_OPERATION' is generated if `glDepthMask' is executed between
5132 the execution of `glBegin' and the corresponding execution of `glEnd'.")
5134 (define-gl-procedure
5140 "Specify mapping of depth values from normalized device coordinates to
5144 Specifies the mapping of the near clipping plane to window
5145 coordinates. The initial value is 0.
5148 Specifies the mapping of the far clipping plane to window
5149 coordinates. The initial value is 1.
5151 After clipping and division by W, depth coordinates range from -1 to 1,
5152 corresponding to the near and far clipping planes. `glDepthRange'
5153 specifies a linear mapping of the normalized depth coordinates in this
5154 range to window depth coordinates. Regardless of the actual depth buffer
5155 implementation, window coordinate depth values are treated as though
5156 they range from 0 through 1 (like color components). Thus, the values
5157 accepted by `glDepthRange' are both clamped to this range before they
5160 The setting of (0,1) maps the near plane to 0 and the far plane to 1.
5161 With this mapping, the depth buffer range is fully utilized.
5163 `GL_INVALID_OPERATION' is generated if `glDepthRange' is executed
5164 between the execution of `glBegin' and the corresponding execution of
5167 (define-gl-procedure
5173 "Detaches a shader object from a program object to which it is attached.
5176 Specifies the program object from which to detach the shader
5180 Specifies the shader object to be detached.
5182 `glDetachShader' detaches the shader object specified by SHADER from the
5183 program object specified by PROGRAM. This command can be used to undo
5184 the effect of the command `glAttachShader'.
5186 If SHADER has already been flagged for deletion by a call to
5187 `glDeleteShader' and it is not attached to any other program object, it
5188 will be deleted after it has been detached.
5190 `GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is a value
5191 that was not generated by OpenGL.
5193 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
5195 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
5197 `GL_INVALID_OPERATION' is generated if SHADER is not attached to
5200 `GL_INVALID_OPERATION' is generated if `glDetachShader' is executed
5201 between the execution of `glBegin' and the corresponding execution of
5204 (define-gl-procedure
5211 "Render primitives from array data.
5214 Specifies what kind of primitives to render. Symbolic constants
5215 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5216 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5217 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5220 Specifies the starting index in the enabled arrays.
5223 Specifies the number of indices to be rendered.
5225 `glDrawArrays' specifies multiple geometric primitives with very few
5226 subroutine calls. Instead of calling a GL procedure to pass each
5227 individual vertex, normal, texture coordinate, edge flag, or color, you
5228 can prespecify separate arrays of vertices, normals, and colors and use
5229 them to construct a sequence of primitives with a single call to
5232 When `glDrawArrays' is called, it uses COUNT sequential elements from
5233 each enabled array to construct a sequence of geometric primitives,
5234 beginning with element FIRST. MODE specifies what kind of primitives are
5235 constructed and how the array elements construct those primitives. If
5236 `GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
5238 Vertex attributes that are modified by `glDrawArrays' have an
5239 unspecified value after `glDrawArrays' returns. For example, if
5240 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5241 after `glDrawArrays' executes. Attributes that aren't modified remain
5244 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5246 `GL_INVALID_VALUE' is generated if COUNT is negative.
5248 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5249 bound to an enabled array and the buffer object's data store is
5252 `GL_INVALID_OPERATION' is generated if `glDrawArrays' is executed
5253 between the execution of `glBegin' and the corresponding `glEnd'.")
5255 (define-gl-procedure
5256 ((glDrawBuffers (n GLsizei) (bufs *) -> void))
5257 "Specifies a list of color buffers to be drawn into.
5260 Specifies the number of buffers in BUFS.
5263 Points to an array of symbolic constants specifying the buffers
5264 into which fragment colors or data values will be written.
5266 `glDrawBuffers' defines an array of buffers into which fragment color
5267 values or fragment data will be written. If no fragment shader is
5268 active, rendering operations will generate only one fragment color per
5269 fragment and it will be written into each of the buffers specified by
5270 BUFS. If a fragment shader is active and it writes a value to the output
5271 variable `gl_FragColor', then that value will be written into each of
5272 the buffers specified by BUFS. If a fragment shader is active and it
5273 writes a value to one or more elements of the output array variable
5274 `gl_FragData[]', then the value of `gl_FragData[0] ' will be written
5275 into the first buffer specified by BUFS, the value of `gl_FragData[1] '
5276 will be written into the second buffer specified by BUFS, and so on up
5277 to `gl_FragData[n-1]'. The draw buffer used for `gl_FragData[n]' and
5278 beyond is implicitly set to be `GL_NONE'.
5280 The symbolic constants contained in BUFS may be any of the following:
5283 The fragment color/data value is not written into any color buffer.
5286 The fragment color/data value is written into the front left color
5290 The fragment color/data value is written into the front right color
5294 The fragment color/data value is written into the back left color
5298 The fragment color/data value is written into the back right color
5302 The fragment color/data value is written into auxiliary buffer `i'.
5304 Except for `GL_NONE', the preceding symbolic constants may not appear
5305 more than once in BUFS. The maximum number of draw buffers supported is
5306 implementation dependent and can be queried by calling `glGet' with the
5307 argument `GL_MAX_DRAW_BUFFERS'. The number of auxiliary buffers can be
5308 queried by calling `glGet' with the argument `GL_AUX_BUFFERS'.
5310 `GL_INVALID_ENUM' is generated if one of the values in BUFS is not an
5313 `GL_INVALID_ENUM' is generated if N is less than 0.
5315 `GL_INVALID_OPERATION' is generated if a symbolic constant other than
5316 `GL_NONE' appears more than once in BUFS.
5318 `GL_INVALID_OPERATION' is generated if any of the entries in BUFS (other
5319 than `GL_NONE' ) indicates a color buffer that does not exist in the
5322 `GL_INVALID_VALUE' is generated if N is greater than
5323 `GL_MAX_DRAW_BUFFERS'.
5325 `GL_INVALID_OPERATION' is generated if `glDrawBuffers' is executed
5326 between the execution of `glBegin' and the corresponding execution of
5329 (define-gl-procedure
5330 ((glDrawBuffer (mode GLenum) -> void))
5331 "Specify which color buffers are to be drawn into.
5334 Specifies up to four color buffers to be drawn into. Symbolic
5335 constants `GL_NONE', `GL_FRONT_LEFT', `GL_FRONT_RIGHT',
5336 `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT', `GL_BACK', `GL_LEFT',
5337 `GL_RIGHT', `GL_FRONT_AND_BACK', and `GL_AUX'I, where I is between
5338 0 and the value of `GL_AUX_BUFFERS' minus 1, are accepted.
5339 (`GL_AUX_BUFFERS' is not the upper limit; use `glGet' to query the
5340 number of available aux buffers.) The initial value is `GL_FRONT'
5341 for single-buffered contexts, and `GL_BACK' for double-buffered
5344 When colors are written to the frame buffer, they are written into the
5345 color buffers specified by `glDrawBuffer'. The specifications are as
5349 No color buffers are written.
5352 Only the front left color buffer is written.
5355 Only the front right color buffer is written.
5358 Only the back left color buffer is written.
5361 Only the back right color buffer is written.
5364 Only the front left and front right color buffers are written. If
5365 there is no front right color buffer, only the front left color
5369 Only the back left and back right color buffers are written. If
5370 there is no back right color buffer, only the back left color
5374 Only the front left and back left color buffers are written. If
5375 there is no back left color buffer, only the front left color
5379 Only the front right and back right color buffers are written. If
5380 there is no back right color buffer, only the front right color
5384 All the front and back color buffers (front left, front right, back
5385 left, back right) are written. If there are no back color buffers,
5386 only the front left and front right color buffers are written. If
5387 there are no right color buffers, only the front left and back left
5388 color buffers are written. If there are no right or back color
5389 buffers, only the front left color buffer is written.
5392 Only auxiliary color buffer I is written.
5394 If more than one color buffer is selected for drawing, then blending or
5395 logical operations are computed and applied independently for each color
5396 buffer and can produce different results in each buffer.
5398 Monoscopic contexts include only LEFT buffers, and stereoscopic contexts
5399 include both LEFT and RIGHT buffers. Likewise, single-buffered contexts
5400 include only FRONT buffers, and double-buffered contexts include both
5401 FRONT and BACK buffers. The context is selected at GL initialization.
5403 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5405 `GL_INVALID_OPERATION' is generated if none of the buffers indicated by
5408 `GL_INVALID_OPERATION' is generated if `glDrawBuffer' is executed
5409 between the execution of `glBegin' and the corresponding execution of
5412 (define-gl-procedure
5420 "Render primitives from array data.
5423 Specifies what kind of primitives to render. Symbolic constants
5424 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5425 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5426 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5429 Specifies the number of elements to be rendered.
5432 Specifies the type of the values in INDICES. Must be one of
5433 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
5436 Specifies a pointer to the location where the indices are stored.
5438 `glDrawElements' specifies multiple geometric primitives with very few
5439 subroutine calls. Instead of calling a GL function to pass each
5440 individual vertex, normal, texture coordinate, edge flag, or color, you
5441 can prespecify separate arrays of vertices, normals, and so on, and use
5442 them to construct a sequence of primitives with a single call to
5445 When `glDrawElements' is called, it uses COUNT sequential elements from
5446 an enabled array, starting at INDICES to construct a sequence of
5447 geometric primitives. MODE specifies what kind of primitives are
5448 constructed and how the array elements construct these primitives. If
5449 more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
5450 not enabled, no geometric primitives are constructed.
5452 Vertex attributes that are modified by `glDrawElements' have an
5453 unspecified value after `glDrawElements' returns. For example, if
5454 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5455 after `glDrawElements' executes. Attributes that aren't modified
5456 maintain their previous values.
5458 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5460 `GL_INVALID_VALUE' is generated if COUNT is negative.
5462 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5463 bound to an enabled array or the element array and the buffer object's
5464 data store is currently mapped.
5466 `GL_INVALID_OPERATION' is generated if `glDrawElements' is executed
5467 between the execution of `glBegin' and the corresponding `glEnd'.")
5469 (define-gl-procedure
5478 "Write a block of pixels to the frame buffer.
5483 Specify the dimensions of the pixel rectangle to be written into
5487 Specifies the format of the pixel data. Symbolic constants
5488 `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT',
5489 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_RED', `GL_GREEN',
5490 `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA' are
5494 Specifies the data type for DATA. Symbolic constants
5495 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
5496 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
5497 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5498 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
5499 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5500 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5501 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5502 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
5506 Specifies a pointer to the pixel data.
5508 `glDrawPixels' reads pixel data from memory and writes it into the frame
5509 buffer relative to the current raster position, provided that the raster
5510 position is valid. Use `glRasterPos' or `glWindowPos' to set the current
5511 raster position; use `glGet' with argument
5512 `GL_CURRENT_RASTER_POSITION_VALID' to determine if the specified raster
5513 position is valid, and `glGet' with argument
5514 `GL_CURRENT_RASTER_POSITION' to query the raster position.
5516 Several parameters define the encoding of pixel data in memory and
5517 control the processing of the pixel data before it is placed in the
5518 frame buffer. These parameters are set with four commands:
5519 `glPixelStore', `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This
5520 reference page describes the effects on `glDrawPixels' of many, but not
5521 all, of the parameters specified by these four commands.
5523 Data is read from DATA as a sequence of signed or unsigned bytes, signed
5524 or unsigned shorts, signed or unsigned integers, or single-precision
5525 floating-point values, depending on TYPE. When TYPE is one of
5526 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
5527 `GL_UNSIGNED_INT', `GL_INT', or `GL_FLOAT' each of these bytes, shorts,
5528 integers, or floating-point values is interpreted as one color or depth
5529 component, or one index, depending on FORMAT. When TYPE is one of
5530 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_SHORT_5_6_5',
5531 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_5_5_5_1',
5532 `GL_UNSIGNED_INT_8_8_8_8', or `GL_UNSIGNED_INT_10_10_10_2', each
5533 unsigned value is interpreted as containing all the components for a
5534 single pixel, with the color components arranged according to FORMAT.
5535 When TYPE is one of `GL_UNSIGNED_BYTE_2_3_3_REV',
5536 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5537 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8_REV', or
5538 `GL_UNSIGNED_INT_2_10_10_10_REV', each unsigned value is interpreted as
5539 containing all color components, specified by FORMAT, for a single pixel
5540 in a reversed order. Indices are always treated individually. Color
5541 components are treated as groups of one, two, three, or four values,
5542 again based on FORMAT. Both individual indices and groups of components
5543 are referred to as pixels. If TYPE is `GL_BITMAP', the data must be
5544 unsigned bytes, and FORMAT must be either `GL_COLOR_INDEX' or
5545 `GL_STENCIL_INDEX'. Each unsigned byte is treated as eight 1-bit pixels,
5546 with bit ordering determined by `GL_UNPACK_LSB_FIRST' (see
5549 WIDTH×HEIGHT pixels are read from memory, starting at location DATA. By
5550 default, these pixels are taken from adjacent memory locations, except
5551 that after all WIDTH pixels are read, the read pointer is advanced to
5552 the next four-byte boundary. The four-byte row alignment is specified by
5553 `glPixelStore' with argument `GL_UNPACK_ALIGNMENT', and it can be set to
5554 one, two, four, or eight bytes. Other pixel store parameters specify
5555 different read pointer advancements, both before the first pixel is read
5556 and after all WIDTH pixels are read. See the `glPixelStore' reference
5557 page for details on these options.
5559 If a non-zero named buffer object is bound to the
5560 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a block of
5561 pixels is specified, DATA is treated as a byte offset into the buffer
5562 object's data store.
5564 The WIDTH×HEIGHT pixels that are read from memory are each operated on
5565 in the same way, based on the values of several parameters specified by
5566 `glPixelTransfer' and `glPixelMap'. The details of these operations, as
5567 well as the target buffer into which the pixels are drawn, are specific
5568 to the format of the pixels, as specified by FORMAT. FORMAT can assume
5569 one of 13 symbolic values:
5572 Each pixel is a single value, a color index. It is converted to
5573 fixed-point format, with an unspecified number of bits to the right
5574 of the binary point, regardless of the memory data type.
5575 Floating-point values convert to true fixed-point values. Signed
5576 and unsigned integer data is converted with all fraction bits set
5577 to 0. Bitmap data convert to either 0 or 1.
5579 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5580 bits and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5581 negative, the shift is to the right. In either case, zero bits fill
5582 otherwise unspecified bit locations in the result.
5584 If the GL is in RGBA mode, the resulting index is converted to an
5585 RGBA pixel with the help of the `GL_PIXEL_MAP_I_TO_R',
5586 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
5587 `GL_PIXEL_MAP_I_TO_A' tables. If the GL is in color index mode, and
5588 if `GL_MAP_COLOR' is true, the index is replaced with the value
5589 that it references in lookup table `GL_PIXEL_MAP_I_TO_I'. Whether
5590 the lookup replacement of the index is done or not, the integer
5591 part of the index is then ANDed with 2^B-1 , where B is the number
5592 of bits in a color index buffer.
5594 The GL then converts the resulting indices or RGBA colors to
5595 fragments by attaching the current raster position Z coordinate and
5596 texture coordinates to each pixel, then assigning X and Y window
5597 coordinates to the N th fragment such that X_N=X_R+N%WIDTH
5600 where (X_R,Y_R) is the current raster position. These pixel
5601 fragments are then treated just like the fragments generated by
5602 rasterizing points, lines, or polygons. Texture mapping, fog, and
5603 all the fragment operations are applied before the fragments are
5604 written to the frame buffer.
5607 Each pixel is a single value, a stencil index. It is converted to
5608 fixed-point format, with an unspecified number of bits to the right
5609 of the binary point, regardless of the memory data type.
5610 Floating-point values convert to true fixed-point values. Signed
5611 and unsigned integer data is converted with all fraction bits set
5612 to 0. Bitmap data convert to either 0 or 1.
5614 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5615 bits, and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5616 negative, the shift is to the right. In either case, zero bits fill
5617 otherwise unspecified bit locations in the result. If
5618 `GL_MAP_STENCIL' is true, the index is replaced with the value that
5619 it references in lookup table `GL_PIXEL_MAP_S_TO_S'. Whether the
5620 lookup replacement of the index is done or not, the integer part of
5621 the index is then ANDed with 2^B-1 , where B is the number of bits
5622 in the stencil buffer. The resulting stencil indices are then
5623 written to the stencil buffer such that the N th index is written
5626 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5628 where (X_R,Y_R) is the current raster position. Only the pixel
5629 ownership test, the scissor test, and the stencil writemask affect
5630 these write operations.
5632 `GL_DEPTH_COMPONENT'
5633 Each pixel is a single-depth component. Floating-point data is
5634 converted directly to an internal floating-point format with
5635 unspecified precision. Signed integer data is mapped linearly to
5636 the internal floating-point format such that the most positive
5637 representable integer value maps to 1.0, and the most negative
5638 representable value maps to -1.0 . Unsigned integer data is mapped
5639 similarly: the largest integer value maps to 1.0, and 0 maps to
5640 0.0. The resulting floating-point depth value is then multiplied by
5641 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
5642 clamped to the range [0,1] .
5644 The GL then converts the resulting depth components to fragments by
5645 attaching the current raster position color or color index and
5646 texture coordinates to each pixel, then assigning X and Y window
5647 coordinates to the N th fragment such that
5649 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5651 where (X_R,Y_R) is the current raster position. These pixel
5652 fragments are then treated just like the fragments generated by
5653 rasterizing points, lines, or polygons. Texture mapping, fog, and
5654 all the fragment operations are applied before the fragments are
5655 written to the frame buffer.
5659 Each pixel is a four-component group: For `GL_RGBA', the red
5660 component is first, followed by green, followed by blue, followed
5661 by alpha; for `GL_BGRA' the order is blue, green, red and then
5662 alpha. Floating-point values are converted directly to an internal
5663 floating-point format with unspecified precision. Signed integer
5664 values are mapped linearly to the internal floating-point format
5665 such that the most positive representable integer value maps to
5666 1.0, and the most negative representable value maps to -1.0 . (Note
5667 that this mapping does not convert 0 precisely to 0.0.) Unsigned
5668 integer data is mapped similarly: The largest integer value maps to
5669 1.0, and 0 maps to 0.0. The resulting floating-point color values
5670 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
5671 C is RED, GREEN, BLUE, and ALPHA for the respective color
5672 components. The results are clamped to the range [0,1] .
5674 If `GL_MAP_COLOR' is true, each color component is scaled by the
5675 size of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the
5676 value that it references in that table. C is R, G, B, or A
5679 The GL then converts the resulting RGBA colors to fragments by
5680 attaching the current raster position Z coordinate and texture
5681 coordinates to each pixel, then assigning X and Y window
5682 coordinates to the N th fragment such that
5684 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5686 where (X_R,Y_R) is the current raster position. These pixel
5687 fragments are then treated just like the fragments generated by
5688 rasterizing points, lines, or polygons. Texture mapping, fog, and
5689 all the fragment operations are applied before the fragments are
5690 written to the frame buffer.
5693 Each pixel is a single red component. This component is converted
5694 to the internal floating-point format in the same way the red
5695 component of an RGBA pixel is. It is then converted to an RGBA
5696 pixel with green and blue set to 0, and alpha set to 1. After this
5697 conversion, the pixel is treated as if it had been read as an RGBA
5701 Each pixel is a single green component. This component is converted
5702 to the internal floating-point format in the same way the green
5703 component of an RGBA pixel is. It is then converted to an RGBA
5704 pixel with red and blue set to 0, and alpha set to 1. After this
5705 conversion, the pixel is treated as if it had been read as an RGBA
5709 Each pixel is a single blue component. This component is converted
5710 to the internal floating-point format in the same way the blue
5711 component of an RGBA pixel is. It is then converted to an RGBA
5712 pixel with red and green set to 0, and alpha set to 1. After this
5713 conversion, the pixel is treated as if it had been read as an RGBA
5717 Each pixel is a single alpha component. This component is converted
5718 to the internal floating-point format in the same way the alpha
5719 component of an RGBA pixel is. It is then converted to an RGBA
5720 pixel with red, green, and blue set to 0. After this conversion,
5721 the pixel is treated as if it had been read as an RGBA pixel.
5725 Each pixel is a three-component group: red first, followed by
5726 green, followed by blue; for `GL_BGR', the first component is blue,
5727 followed by green and then red. Each component is converted to the
5728 internal floating-point format in the same way the red, green, and
5729 blue components of an RGBA pixel are. The color triple is converted
5730 to an RGBA pixel with alpha set to 1. After this conversion, the
5731 pixel is treated as if it had been read as an RGBA pixel.
5734 Each pixel is a single luminance component. This component is
5735 converted to the internal floating-point format in the same way the
5736 red component of an RGBA pixel is. It is then converted to an RGBA
5737 pixel with red, green, and blue set to the converted luminance
5738 value, and alpha set to 1. After this conversion, the pixel is
5739 treated as if it had been read as an RGBA pixel.
5741 `GL_LUMINANCE_ALPHA'
5742 Each pixel is a two-component group: luminance first, followed by
5743 alpha. The two components are converted to the internal
5744 floating-point format in the same way the red component of an RGBA
5745 pixel is. They are then converted to an RGBA pixel with red, green,
5746 and blue set to the converted luminance value, and alpha set to the
5747 converted alpha value. After this conversion, the pixel is treated
5748 as if it had been read as an RGBA pixel.
5750 The following table summarizes the meaning of the valid constants for
5756 *Corresponding Type*
5759 unsigned 8-bit integer
5762 signed 8-bit integer
5765 single bits in unsigned 8-bit integers
5768 unsigned 16-bit integer
5771 signed 16-bit integer
5774 unsigned 32-bit integer
5780 single-precision floating-point
5782 `GL_UNSIGNED_BYTE_3_3_2'
5783 unsigned 8-bit integer
5785 `GL_UNSIGNED_BYTE_2_3_3_REV'
5786 unsigned 8-bit integer with reversed component ordering
5788 `GL_UNSIGNED_SHORT_5_6_5'
5789 unsigned 16-bit integer
5791 `GL_UNSIGNED_SHORT_5_6_5_REV'
5792 unsigned 16-bit integer with reversed component ordering
5794 `GL_UNSIGNED_SHORT_4_4_4_4'
5795 unsigned 16-bit integer
5797 `GL_UNSIGNED_SHORT_4_4_4_4_REV'
5798 unsigned 16-bit integer with reversed component ordering
5800 `GL_UNSIGNED_SHORT_5_5_5_1'
5801 unsigned 16-bit integer
5803 `GL_UNSIGNED_SHORT_1_5_5_5_REV'
5804 unsigned 16-bit integer with reversed component ordering
5806 `GL_UNSIGNED_INT_8_8_8_8'
5807 unsigned 32-bit integer
5809 `GL_UNSIGNED_INT_8_8_8_8_REV'
5810 unsigned 32-bit integer with reversed component ordering
5812 `GL_UNSIGNED_INT_10_10_10_2'
5813 unsigned 32-bit integer
5815 `GL_UNSIGNED_INT_2_10_10_10_REV'
5816 unsigned 32-bit integer with reversed component ordering
5820 The rasterization described so far assumes pixel zoom factors of 1. If
5821 `glPixelZoom' is used to change the X and Y pixel zoom factors, pixels
5822 are converted to fragments as follows. If (X_R,Y_R) is the current
5823 raster position, and a given pixel is in the N th column and M th row of
5824 the pixel rectangle, then fragments are generated for pixels whose
5825 centers are in the rectangle with corners at
5827 (X_R+ZOOM_X,\u2062N,Y_R+ZOOM_Y,\u2062M) (X_R+ZOOM_X,\u2061(N+1,),Y_R+ZOOM_Y,\u2061(M+1,))
5829 where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
5832 `GL_INVALID_ENUM' is generated if FORMAT or TYPE is not one of the
5835 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
5836 either `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
5838 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
5840 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
5841 there is no stencil buffer.
5843 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_RED', `GL_GREEN',
5844 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_RGBA', `GL_BGR', `GL_BGRA',
5845 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA', and the GL is in color index
5848 `GL_INVALID_OPERATION' is generated if FORMAT is one of
5849 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5850 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
5853 `GL_INVALID_OPERATION' is generated if FORMAT is one of
5854 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5855 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5856 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5857 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
5858 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
5860 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5861 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
5862 data store is currently mapped.
5864 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5865 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
5866 unpacked from the buffer object such that the memory reads required
5867 would exceed the data store size.
5869 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5870 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
5871 divisible into the number of bytes needed to store in memory a datum
5874 `GL_INVALID_OPERATION' is generated if `glDrawPixels' is executed
5875 between the execution of `glBegin' and the corresponding execution of
5878 (define-gl-procedure
5879 ((glDrawRangeElements
5888 "Render primitives from array data.
5891 Specifies what kind of primitives to render. Symbolic constants
5892 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5893 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5894 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5897 Specifies the minimum array index contained in INDICES.
5900 Specifies the maximum array index contained in INDICES.
5903 Specifies the number of elements to be rendered.
5906 Specifies the type of the values in INDICES. Must be one of
5907 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
5910 Specifies a pointer to the location where the indices are stored.
5912 `glDrawRangeElements' is a restricted form of `glDrawElements'. MODE,
5913 START, END, and COUNT match the corresponding arguments to
5914 `glDrawElements', with the additional constraint that all values in the
5915 arrays COUNT must lie between START and END, inclusive.
5917 Implementations denote recommended maximum amounts of vertex and index
5918 data, which may be queried by calling `glGet' with argument
5919 `GL_MAX_ELEMENTS_VERTICES' and `GL_MAX_ELEMENTS_INDICES'. If END-START+1
5920 is greater than the value of `GL_MAX_ELEMENTS_VERTICES', or if COUNT is
5921 greater than the value of `GL_MAX_ELEMENTS_INDICES', then the call may
5922 operate at reduced performance. There is no requirement that all
5923 vertices in the range [START,END] be referenced. However, the
5924 implementation may partially process unused vertices, reducing
5925 performance from what could be achieved with an optimal index set.
5927 When `glDrawRangeElements' is called, it uses COUNT sequential elements
5928 from an enabled array, starting at START to construct a sequence of
5929 geometric primitives. MODE specifies what kind of primitives are
5930 constructed, and how the array elements construct these primitives. If
5931 more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
5932 not enabled, no geometric primitives are constructed.
5934 Vertex attributes that are modified by `glDrawRangeElements' have an
5935 unspecified value after `glDrawRangeElements' returns. For example, if
5936 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5937 after `glDrawRangeElements' executes. Attributes that aren't modified
5938 maintain their previous values.
5940 It is an error for indices to lie outside the range [START,END] , but
5941 implementations may not check for this situation. Such indices cause
5942 implementation-dependent behavior.
5944 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5946 `GL_INVALID_VALUE' is generated if COUNT is negative.
5948 `GL_INVALID_VALUE' is generated if END<START .
5950 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5951 bound to an enabled array or the element array and the buffer object's
5952 data store is currently mapped.
5954 `GL_INVALID_OPERATION' is generated if `glDrawRangeElements' is executed
5955 between the execution of `glBegin' and the corresponding `glEnd'.")
5957 (define-gl-procedure
5963 "Define an array of edge flags.
5966 Specifies the byte offset between consecutive edge flags. If STRIDE
5967 is 0, the edge flags are understood to be tightly packed in the
5968 array. The initial value is 0.
5971 Specifies a pointer to the first edge flag in the array. The
5974 `glEdgeFlagPointer' specifies the location and data format of an array
5975 of boolean edge flags to use when rendering. STRIDE specifies the byte
5976 stride from one edge flag to the next, allowing vertices and attributes
5977 to be packed into a single array or stored in separate arrays.
5979 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
5980 target (see `glBindBuffer') while an edge flag array is specified,
5981 POINTER is treated as a byte offset into the buffer object's data store.
5982 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
5983 edge flag vertex array client-side state
5984 (`GL_EDGE_FLAG_ARRAY_BUFFER_BINDING').
5986 When an edge flag array is specified, STRIDE and POINTER are saved as
5987 client-side state, in addition to the current vertex array buffer object
5990 To enable and disable the edge flag array, call `glEnableClientState'
5991 and `glDisableClientState' with the argument `GL_EDGE_FLAG_ARRAY'. If
5992 enabled, the edge flag array is used when `glDrawArrays',
5993 `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
5994 `glDrawRangeElements', or `glArrayElement' is called.
5996 `GL_INVALID_ENUM' is generated if STRIDE is negative.")
5998 (define-gl-procedure
5999 ((glEdgeFlag (flag GLboolean) -> void))
6000 "Flag edges as either boundary or nonboundary.
6003 Specifies the current edge flag value, either `GL_TRUE' or
6004 `GL_FALSE'. The initial value is `GL_TRUE'.
6006 Each vertex of a polygon, separate triangle, or separate quadrilateral
6007 specified between a `glBegin'/`glEnd' pair is marked as the start of
6008 either a boundary or nonboundary edge. If the current edge flag is true
6009 when the vertex is specified, the vertex is marked as the start of a
6010 boundary edge. Otherwise, the vertex is marked as the start of a
6011 nonboundary edge. `glEdgeFlag' sets the edge flag bit to `GL_TRUE' if
6012 FLAG is `GL_TRUE' and to `GL_FALSE' otherwise.
6014 The vertices of connected triangles and connected quadrilaterals are
6015 always marked as boundary, regardless of the value of the edge flag.
6017 Boundary and nonboundary edge flags on vertices are significant only if
6018 `GL_POLYGON_MODE' is set to `GL_POINT' or `GL_LINE'. See
6021 (define-gl-procedure
6022 ((glEnableClientState (cap GLenum) -> void)
6023 (glDisableClientState (cap GLenum) -> void))
6024 "Enable or disable client-side capability.
6027 Specifies the capability to enable. Symbolic constants
6028 `GL_COLOR_ARRAY', `GL_EDGE_FLAG_ARRAY', `GL_FOG_COORD_ARRAY',
6029 `GL_INDEX_ARRAY', `GL_NORMAL_ARRAY', `GL_SECONDARY_COLOR_ARRAY',
6030 `GL_TEXTURE_COORD_ARRAY', and `GL_VERTEX_ARRAY' are accepted.
6032 `glEnableClientState' and `glDisableClientState' enable or disable
6033 individual client-side capabilities. By default, all client-side
6034 capabilities are disabled. Both `glEnableClientState' and
6035 `glDisableClientState' take a single argument, CAP, which can assume one
6036 of the following values:
6039 If enabled, the color array is enabled for writing and used during
6040 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6041 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6042 is called. See `glColorPointer'.
6044 `GL_EDGE_FLAG_ARRAY'
6045 If enabled, the edge flag array is enabled for writing and used
6046 during rendering when `glArrayElement', `glDrawArrays',
6047 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6048 `glMultiDrawElements' is called. See `glEdgeFlagPointer'.
6050 `GL_FOG_COORD_ARRAY'
6051 If enabled, the fog coordinate array is enabled for writing and
6052 used during rendering when `glArrayElement', `glDrawArrays',
6053 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6054 `glMultiDrawElements' is called. See `glFogCoordPointer'.
6057 If enabled, the index array is enabled for writing and used during
6058 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6059 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6060 is called. See `glIndexPointer'.
6063 If enabled, the normal array is enabled for writing and used during
6064 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6065 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6066 is called. See `glNormalPointer'.
6068 `GL_SECONDARY_COLOR_ARRAY'
6069 If enabled, the secondary color array is enabled for writing and
6070 used during rendering when `glArrayElement', `glDrawArrays',
6071 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6072 `glMultiDrawElements' is called. See `glColorPointer'.
6074 `GL_TEXTURE_COORD_ARRAY'
6075 If enabled, the texture coordinate array is enabled for writing and
6076 used during rendering when `glArrayElement', `glDrawArrays',
6077 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6078 `glMultiDrawElements' is called. See `glTexCoordPointer'.
6081 If enabled, the vertex array is enabled for writing and used during
6082 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6083 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6084 is called. See `glVertexPointer'.
6086 `GL_INVALID_ENUM' is generated if CAP is not an accepted value.
6088 `glEnableClientState' is not allowed between the execution of `glBegin'
6089 and the corresponding `glEnd', but an error may or may not be generated.
6090 If no error is generated, the behavior is undefined.")
6092 (define-gl-procedure
6093 ((glEnableVertexAttribArray
6097 (glDisableVertexAttribArray
6101 "Enable or disable a generic vertex attribute array.
6104 Specifies the index of the generic vertex attribute to be enabled
6107 `glEnableVertexAttribArray' enables the generic vertex attribute array
6108 specified by INDEX. `glDisableVertexAttribArray' disables the generic
6109 vertex attribute array specified by INDEX. By default, all client-side
6110 capabilities are disabled, including all generic vertex attribute
6111 arrays. If enabled, the values in the generic vertex attribute array
6112 will be accessed and used for rendering when calls are made to vertex
6113 array commands such as `glDrawArrays', `glDrawElements',
6114 `glDrawRangeElements', `glArrayElement', `glMultiDrawElements', or
6115 `glMultiDrawArrays'.
6117 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
6118 `GL_MAX_VERTEX_ATTRIBS'.
6120 `GL_INVALID_OPERATION' is generated if either `glEnableVertexAttribArray
6121 ' or `glDisableVertexAttribArray ' is executed between the execution of
6122 `glBegin' and the corresponding execution of `glEnd'.")
6124 (define-gl-procedure
6125 ((glEnable (cap GLenum) -> void)
6126 (glDisable (cap GLenum) -> void))
6127 "Enable or disable server-side GL capabilities.
6130 Specifies a symbolic constant indicating a GL capability.
6132 `glEnable' and `glDisable' enable and disable various capabilities. Use
6133 `glIsEnabled' or `glGet' to determine the current setting of any
6134 capability. The initial value for each capability with the exception of
6135 `GL_DITHER' and `GL_MULTISAMPLE' is `GL_FALSE'. The initial value for
6136 `GL_DITHER' and `GL_MULTISAMPLE' is `GL_TRUE'.
6138 Both `glEnable' and `glDisable' take a single argument, CAP, which can
6139 assume one of the following values:
6144 If enabled, do alpha testing. See `glAlphaFunc'.
6149 If enabled, generate normal vectors when either `GL_MAP2_VERTEX_3'
6150 or `GL_MAP2_VERTEX_4' is used to generate vertices. See `glMap2'.
6155 If enabled, blend the computed fragment color values with the
6156 values in the color buffers. See `glBlendFunc'.
6161 If enabled, clip geometry against user-defined clipping plane I.
6167 If enabled, apply the currently selected logical operation to the
6168 computed fragment color and color buffer values. See `glLogicOp'.
6173 If enabled, have one or more material parameters track the current
6174 color. See `glColorMaterial'.
6179 If enabled and no fragment shader is active, add the secondary
6180 color value to the computed fragment color. See `glSecondaryColor'.
6185 If enabled, perform a color table lookup on the incoming RGBA color
6186 values. See `glColorTable'.
6191 If enabled, perform a 1D convolution operation on incoming RGBA
6192 color values. See `glConvolutionFilter1D'.
6197 If enabled, perform a 2D convolution operation on incoming RGBA
6198 color values. See `glConvolutionFilter2D'.
6203 If enabled, cull polygons based on their winding in window
6204 coordinates. See `glCullFace'.
6209 If enabled, do depth comparisons and update the depth buffer. Note
6210 that even if the depth buffer exists and the depth mask is
6211 non-zero, the depth buffer is not updated if the depth test is
6212 disabled. See `glDepthFunc' and `glDepthRange'.
6217 If enabled, dither color components or indices before they are
6218 written to the color buffer.
6223 If enabled and no fragment shader is active, blend a fog color into
6224 the post-texturing color. See `glFog'.
6229 If enabled, histogram incoming RGBA color values. See
6235 If enabled, apply the currently selected logical operation to the
6236 incoming index and color buffer indices. See `glLogicOp'.
6241 If enabled, include light I in the evaluation of the lighting
6242 equation. See `glLightModel' and `glLight'.
6247 If enabled and no vertex shader is active, use the current lighting
6248 parameters to compute the vertex color or index. Otherwise, simply
6249 associate the current color or index with each vertex. See
6250 `glMaterial', `glLightModel', and `glLight'.
6255 If enabled, draw lines with correct filtering. Otherwise, draw
6256 aliased lines. See `glLineWidth'.
6261 If enabled, use the current line stipple pattern when drawing
6262 lines. See `glLineStipple'.
6267 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6268 `glEvalPoint1' generate RGBA values. See `glMap1'.
6273 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6274 `glEvalPoint1' generate color indices. See `glMap1'.
6279 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6280 `glEvalPoint1' generate normals. See `glMap1'.
6282 `GL_MAP1_TEXTURE_COORD_1'
6285 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6286 `glEvalPoint1' generate S texture coordinates. See `glMap1'.
6288 `GL_MAP1_TEXTURE_COORD_2'
6291 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6292 `glEvalPoint1' generate S and T texture coordinates. See `glMap1'.
6294 `GL_MAP1_TEXTURE_COORD_3'
6297 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6298 `glEvalPoint1' generate S, T, and R texture coordinates. See
6301 `GL_MAP1_TEXTURE_COORD_4'
6304 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6305 `glEvalPoint1' generate S, T, R, and Q texture coordinates. See
6311 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6312 `glEvalPoint1' generate X, Y, and Z vertex coordinates. See
6318 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6319 `glEvalPoint1' generate homogeneous X, Y, Z, and W vertex
6320 coordinates. See `glMap1'.
6325 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6326 `glEvalPoint2' generate RGBA values. See `glMap2'.
6331 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6332 `glEvalPoint2' generate color indices. See `glMap2'.
6337 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6338 `glEvalPoint2' generate normals. See `glMap2'.
6340 `GL_MAP2_TEXTURE_COORD_1'
6343 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6344 `glEvalPoint2' generate S texture coordinates. See `glMap2'.
6346 `GL_MAP2_TEXTURE_COORD_2'
6349 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6350 `glEvalPoint2' generate S and T texture coordinates. See `glMap2'.
6352 `GL_MAP2_TEXTURE_COORD_3'
6355 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6356 `glEvalPoint2' generate S, T, and R texture coordinates. See
6359 `GL_MAP2_TEXTURE_COORD_4'
6362 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6363 `glEvalPoint2' generate S, T, R, and Q texture coordinates. See
6369 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6370 `glEvalPoint2' generate X, Y, and Z vertex coordinates. See
6376 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6377 `glEvalPoint2' generate homogeneous X, Y, Z, and W vertex
6378 coordinates. See `glMap2'.
6383 If enabled, compute the minimum and maximum values of incoming RGBA
6384 color values. See `glMinmax'.
6389 If enabled, use multiple fragment samples in computing the final
6390 color of a pixel. See `glSampleCoverage'.
6395 If enabled and no vertex shader is active, normal vectors are
6396 normalized to unit length after transformation and before lighting.
6397 This method is generally less efficient than `GL_RESCALE_NORMAL'.
6398 See `glNormal' and `glNormalPointer'.
6403 If enabled, draw points with proper filtering. Otherwise, draw
6404 aliased points. See `glPointSize'.
6409 If enabled, calculate texture coordinates for points based on
6410 texture environment and point parameter settings. Otherwise texture
6411 coordinates are constant across points.
6413 `GL_POLYGON_OFFSET_FILL'
6416 If enabled, and if the polygon is rendered in `GL_FILL' mode, an
6417 offset is added to depth values of a polygon's fragments before the
6418 depth comparison is performed. See `glPolygonOffset'.
6420 `GL_POLYGON_OFFSET_LINE'
6423 If enabled, and if the polygon is rendered in `GL_LINE' mode, an
6424 offset is added to depth values of a polygon's fragments before the
6425 depth comparison is performed. See `glPolygonOffset'.
6427 `GL_POLYGON_OFFSET_POINT'
6430 If enabled, an offset is added to depth values of a polygon's
6431 fragments before the depth comparison is performed, if the polygon
6432 is rendered in `GL_POINT' mode. See `glPolygonOffset'.
6437 If enabled, draw polygons with proper filtering. Otherwise, draw
6438 aliased polygons. For correct antialiased polygons, an alpha buffer
6439 is needed and the polygons must be sorted front to back.
6441 `GL_POLYGON_STIPPLE'
6444 If enabled, use the current polygon stipple pattern when rendering
6445 polygons. See `glPolygonStipple'.
6447 `GL_POST_COLOR_MATRIX_COLOR_TABLE'
6450 If enabled, perform a color table lookup on RGBA color values after
6451 color matrix transformation. See `glColorTable'.
6453 `GL_POST_CONVOLUTION_COLOR_TABLE'
6456 If enabled, perform a color table lookup on RGBA color values after
6457 convolution. See `glColorTable'.
6462 If enabled and no vertex shader is active, normal vectors are
6463 scaled after transformation and before lighting by a factor
6464 computed from the modelview matrix. If the modelview matrix scales
6465 space uniformly, this has the effect of restoring the transformed
6466 normal to unit length. This method is generally more efficient than
6467 `GL_NORMALIZE'. See `glNormal' and `glNormalPointer'.
6469 `GL_SAMPLE_ALPHA_TO_COVERAGE'
6472 If enabled, compute a temporary coverage value where each bit is
6473 determined by the alpha value at the corresponding sample location.
6474 The temporary coverage value is then ANDed with the fragment
6477 `GL_SAMPLE_ALPHA_TO_ONE'
6480 If enabled, each sample alpha value is replaced by the maximum
6481 representable alpha value.
6483 `GL_SAMPLE_COVERAGE'
6486 If enabled, the fragment's coverage is ANDed with the temporary
6487 coverage value. If `GL_SAMPLE_COVERAGE_INVERT' is set to `GL_TRUE',
6488 invert the coverage value. See `glSampleCoverage'.
6493 If enabled, perform a two-dimensional convolution operation using a
6494 separable convolution filter on incoming RGBA color values. See
6495 `glSeparableFilter2D'.
6500 If enabled, discard fragments that are outside the scissor
6501 rectangle. See `glScissor'.
6506 If enabled, do stencil testing and update the stencil buffer. See
6507 `glStencilFunc' and `glStencilOp'.
6512 If enabled and no fragment shader is active, one-dimensional
6513 texturing is performed (unless two- or three-dimensional or
6514 cube-mapped texturing is also enabled). See `glTexImage1D'.
6519 If enabled and no fragment shader is active, two-dimensional
6520 texturing is performed (unless three-dimensional or cube-mapped
6521 texturing is also enabled). See `glTexImage2D'.
6526 If enabled and no fragment shader is active, three-dimensional
6527 texturing is performed (unless cube-mapped texturing is also
6528 enabled). See `glTexImage3D'.
6530 `GL_TEXTURE_CUBE_MAP'
6533 If enabled and no fragment shader is active, cube-mapped texturing
6534 is performed. See `glTexImage2D'.
6539 If enabled and no vertex shader is active, the Q texture coordinate
6540 is computed using the texture generation function defined with
6541 `glTexGen'. Otherwise, the current Q texture coordinate is used.
6547 If enabled and no vertex shader is active, the R texture coordinate
6548 is computed using the texture generation function defined with
6549 `glTexGen'. Otherwise, the current R texture coordinate is used.
6555 If enabled and no vertex shader is active, the S texture coordinate
6556 is computed using the texture generation function defined with
6557 `glTexGen'. Otherwise, the current S texture coordinate is used.
6563 If enabled and no vertex shader is active, the T texture coordinate
6564 is computed using the texture generation function defined with
6565 `glTexGen'. Otherwise, the current T texture coordinate is used.
6568 `GL_VERTEX_PROGRAM_POINT_SIZE'
6571 If enabled and a vertex shader is active, then the derived point
6572 size is taken from the (potentially clipped) shader builtin
6573 `gl_PointSize' and clamped to the implementation-dependent point
6576 `GL_VERTEX_PROGRAM_TWO_SIDE'
6579 If enabled and a vertex shader is active, it specifies that the GL
6580 will choose between front and back colors based on the polygon's
6581 face direction of which the vertex being shaded is a part. It has
6582 no effect on points or lines.
6584 `GL_INVALID_ENUM' is generated if CAP is not one of the values listed
6587 `GL_INVALID_OPERATION' is generated if `glEnable' or `glDisable' is
6588 executed between the execution of `glBegin' and the corresponding
6589 execution of `glEnd'.")
6591 (define-gl-procedure
6592 ((glEvalCoord1d (u GLdouble) -> void)
6593 (glEvalCoord2d (u GLdouble) (v GLdouble) -> void))
6594 "Evaluate enabled one- and two-dimensional maps.
6597 Specifies a value that is the domain coordinate U to the basis
6598 function defined in a previous `glMap1' or `glMap2' command.
6601 Specifies a value that is the domain coordinate V to the basis
6602 function defined in a previous `glMap2' command. This argument is
6603 not present in a `glEvalCoord1' command.
6605 `glEvalCoord1' evaluates enabled one-dimensional maps at argument U.
6606 `glEvalCoord2' does the same for two-dimensional maps using two domain
6607 values, U and V. To define a map, call `glMap1' and `glMap2'; to enable
6608 and disable it, call `glEnable' and `glDisable'.
6610 When one of the `glEvalCoord' commands is issued, all currently enabled
6611 maps of the indicated dimension are evaluated. Then, for each enabled
6612 map, it is as if the corresponding GL command had been issued with the
6613 computed value. That is, if `GL_MAP1_INDEX' or `GL_MAP2_INDEX' is
6614 enabled, a `glIndex' command is simulated. If `GL_MAP1_COLOR_4' or
6615 `GL_MAP2_COLOR_4' is enabled, a `glColor' command is simulated. If
6616 `GL_MAP1_NORMAL' or `GL_MAP2_NORMAL' is enabled, a normal vector is
6617 produced, and if any of `GL_MAP1_TEXTURE_COORD_1',
6618 `GL_MAP1_TEXTURE_COORD_2', `GL_MAP1_TEXTURE_COORD_3',
6619 `GL_MAP1_TEXTURE_COORD_4', `GL_MAP2_TEXTURE_COORD_1',
6620 `GL_MAP2_TEXTURE_COORD_2', `GL_MAP2_TEXTURE_COORD_3', or
6621 `GL_MAP2_TEXTURE_COORD_4' is enabled, then an appropriate `glTexCoord'
6622 command is simulated.
6624 For color, color index, normal, and texture coordinates the GL uses
6625 evaluated values instead of current values for those evaluations that
6626 are enabled, and current values otherwise, However, the evaluated values
6627 do not update the current values. Thus, if `glVertex' commands are
6628 interspersed with `glEvalCoord' commands, the color, normal, and texture
6629 coordinates associated with the `glVertex' commands are not affected by
6630 the values generated by the `glEvalCoord' commands, but only by the most
6631 recent `glColor', `glIndex', `glNormal', and `glTexCoord' commands.
6633 No commands are issued for maps that are not enabled. If more than one
6634 texture evaluation is enabled for a particular dimension (for example,
6635 `GL_MAP2_TEXTURE_COORD_1' and `GL_MAP2_TEXTURE_COORD_2'), then only the
6636 evaluation of the map that produces the larger number of coordinates (in
6637 this case, `GL_MAP2_TEXTURE_COORD_2') is carried out. `GL_MAP1_VERTEX_4'
6638 overrides `GL_MAP1_VERTEX_3', and `GL_MAP2_VERTEX_4' overrides
6639 `GL_MAP2_VERTEX_3', in the same manner. If neither a three- nor a
6640 four-component vertex map is enabled for the specified dimension, the
6641 `glEvalCoord' command is ignored.
6643 If you have enabled automatic normal generation, by calling `glEnable'
6644 with argument `GL_AUTO_NORMAL', `glEvalCoord2' generates surface normals
6645 analytically, regardless of the contents or enabling of the
6646 `GL_MAP2_NORMAL' map. Let
6648 `m'=∂`p',/∂U,,×∂`p',/∂V,,
6650 Then the generated normal `n' is `n'=`m'/∥`m',∥,
6652 If automatic normal generation is disabled, the corresponding normal map
6653 `GL_MAP2_NORMAL', if enabled, is used to produce a normal. If neither
6654 automatic normal generation nor a normal map is enabled, no normal is
6655 generated for `glEvalCoord2' commands.")
6657 (define-gl-procedure
6672 "Compute a one- or two-dimensional grid of points or lines.
6675 In `glEvalMesh1', specifies whether to compute a one-dimensional
6676 mesh of points or lines. Symbolic constants `GL_POINT' and
6677 `GL_LINE' are accepted.
6682 Specify the first and last integer values for grid domain variable
6685 `glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
6686 and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
6687 steps through the integer domain of a one- or two-dimensional grid,
6688 whose range is the domain of the evaluation maps specified by `glMap1'
6689 and `glMap2'. MODE determines whether the resulting vertices are
6690 connected as points, lines, or filled polygons.
6692 In the one-dimensional case, `glEvalMesh1', the mesh is generated as if
6693 the following code fragment were executed:
6699 for ( i = I1; i <= I2; i += 1 )
6700 glEvalCoord1( i·ΔU+U_1
6707 and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
6708 command. TYPE is `GL_POINTS' if MODE is `GL_POINT', or `GL_LINES' if
6711 The one absolute numeric requirement is that if I=N , then the value
6712 computed from I·ΔU+U_1 is exactly U_2 .
6714 In the two-dimensional case, `glEvalMesh2', let .cp ΔU=(U_2-U_1,)/N
6718 where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
6719 recent `glMapGrid2' command. Then, if MODE is `GL_FILL', the
6720 `glEvalMesh2' command is equivalent to:
6725 for ( j = J1; j < J2; j += 1 ) {
6726 glBegin( GL_QUAD_STRIP );
6727 for ( i = I1; i <= I2; i += 1 ) {
6728 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6731 glEvalCoord2( i·ΔU+U_1,(j+1,)·ΔV+V_1
6738 If MODE is `GL_LINE', then a call to `glEvalMesh2' is equivalent to:
6743 for ( j = J1; j <= J2; j += 1 ) {
6744 glBegin( GL_LINE_STRIP );
6745 for ( i = I1; i <= I2; i += 1 )
6746 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6752 for ( i = I1; i <= I2; i += 1 ) {
6753 glBegin( GL_LINE_STRIP );
6754 for ( j = J1; j <= J1; j += 1 )
6755 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6761 And finally, if MODE is `GL_POINT', then a call to `glEvalMesh2' is
6767 glBegin( GL_POINTS );
6768 for ( j = J1; j <= J2; j += 1 )
6769 for ( i = I1; i <= I2; i += 1 )
6770 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6775 In all three cases, the only absolute numeric requirements are that if
6776 I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
6777 , then the value computed from J·ΔV+V_1 is exactly V_2 .
6779 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
6781 `GL_INVALID_OPERATION' is generated if `glEvalMesh' is executed between
6782 the execution of `glBegin' and the corresponding execution of `glEnd'.")
6784 (define-gl-procedure
6785 ((glEvalPoint1 (i GLint) -> void)
6786 (glEvalPoint2 (i GLint) (j GLint) -> void))
6787 "Generate and evaluate a single point in a mesh.
6790 Specifies the integer value for grid domain variable I .
6793 Specifies the integer value for grid domain variable J
6794 (`glEvalPoint2' only).
6796 `glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
6797 and evaluate a series of evenly spaced map domain values. `glEvalPoint'
6798 can be used to evaluate a single grid point in the same gridspace that
6799 is traversed by `glEvalMesh'. Calling `glEvalPoint1' is equivalent to
6800 calling where ΔU=(U_2-U_1,)/N
6803 glEvalCoord1( i·ΔU+U_1
6807 and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
6808 command. The one absolute numeric requirement is that if I=N , then the
6809 value computed from I·ΔU+U_1 is exactly U_2 .
6811 In the two-dimensional case, `glEvalPoint2', let
6813 ΔU=(U_2-U_1,)/N ΔV=(V_2-V_1,)/M
6815 where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
6816 recent `glMapGrid2' command. Then the `glEvalPoint2' command is
6817 equivalent to calling The only absolute numeric requirements are that if
6818 I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
6819 , then the value computed from J·ΔV+V_1 is exactly V_2 .
6822 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6826 (define-gl-procedure
6833 "Controls feedback mode.
6836 Specifies the maximum number of values that can be written into
6840 Specifies a symbolic constant that describes the information that
6841 will be returned for each vertex. `GL_2D', `GL_3D', `GL_3D_COLOR',
6842 `GL_3D_COLOR_TEXTURE', and `GL_4D_COLOR_TEXTURE' are accepted.
6845 Returns the feedback data.
6847 The `glFeedbackBuffer' function controls feedback. Feedback, like
6848 selection, is a GL mode. The mode is selected by calling `glRenderMode'
6849 with `GL_FEEDBACK'. When the GL is in feedback mode, no pixels are
6850 produced by rasterization. Instead, information about primitives that
6851 would have been rasterized is fed back to the application using the GL.
6853 `glFeedbackBuffer' has three arguments: BUFFER is a pointer to an array
6854 of floating-point values into which feedback information is placed. SIZE
6855 indicates the size of the array. TYPE is a symbolic constant describing
6856 the information that is fed back for each vertex. `glFeedbackBuffer'
6857 must be issued before feedback mode is enabled (by calling
6858 `glRenderMode' with argument `GL_FEEDBACK'). Setting `GL_FEEDBACK'
6859 without establishing the feedback buffer, or calling `glFeedbackBuffer'
6860 while the GL is in feedback mode, is an error.
6862 When `glRenderMode' is called while in feedback mode, it returns the
6863 number of entries placed in the feedback array and resets the feedback
6864 array pointer to the base of the feedback buffer. The returned value
6865 never exceeds SIZE. If the feedback data required more room than was
6866 available in BUFFER, `glRenderMode' returns a negative value. To take
6867 the GL out of feedback mode, call `glRenderMode' with a parameter value
6868 other than `GL_FEEDBACK'.
6870 While in feedback mode, each primitive, bitmap, or pixel rectangle that
6871 would be rasterized generates a block of values that are copied into the
6872 feedback array. If doing so would cause the number of entries to exceed
6873 the maximum, the block is partially written so as to fill the array (if
6874 there is any room left at all), and an overflow flag is set. Each block
6875 begins with a code indicating the primitive type, followed by values
6876 that describe the primitive's vertices and associated data. Entries are
6877 also written for bitmaps and pixel rectangles. Feedback occurs after
6878 polygon culling and `glPolygonMode' interpretation of polygons has taken
6879 place, so polygons that are culled are not returned in the feedback
6880 buffer. It can also occur after polygons with more than three edges are
6881 broken up into triangles, if the GL implementation renders polygons by
6882 performing this decomposition.
6884 The `glPassThrough' command can be used to insert a marker into the
6885 feedback buffer. See `glPassThrough'.
6887 Following is the grammar for the blocks of values written into the
6888 feedback buffer. Each primitive is indicated with a unique identifying
6889 value followed by some number of vertices. Polygon entries include an
6890 integer value indicating how many vertices follow. A vertex is fed back
6891 as some number of floating-point values, as determined by TYPE. Colors
6892 are fed back as four values in RGBA mode and one value in color index
6895 feedbackList ← feedbackItem feedbackList | feedbackItem feedbackItem ←
6896 point | lineSegment | polygon | bitmap | pixelRectangle | passThru point
6897 ← `GL_POINT_TOKEN' vertex lineSegment ← `GL_LINE_TOKEN' vertex vertex |
6898 `GL_LINE_RESET_TOKEN' vertex vertex polygon ← `GL_POLYGON_TOKEN' n
6899 polySpec polySpec ← polySpec vertex | vertex vertex vertex bitmap ←
6900 `GL_BITMAP_TOKEN' vertex pixelRectangle ← `GL_DRAW_PIXEL_TOKEN' vertex |
6901 `GL_COPY_PIXEL_TOKEN' vertex passThru ← `GL_PASS_THROUGH_TOKEN' value
6902 vertex ← 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture 2d ← value
6903 value 3d ← value value value 3dColor ← value value value color
6904 3dColorTexture ← value value value color tex 4dColorTexture ← value
6905 value value value color tex color ← rgba | index rgba ← value value
6906 value value index ← value tex ← value value value value
6908 VALUE is a floating-point number, and N is a floating-point integer
6909 giving the number of vertices in the polygon. `GL_POINT_TOKEN',
6910 `GL_LINE_TOKEN', `GL_LINE_RESET_TOKEN', `GL_POLYGON_TOKEN',
6911 `GL_BITMAP_TOKEN', `GL_DRAW_PIXEL_TOKEN', `GL_COPY_PIXEL_TOKEN' and
6912 `GL_PASS_THROUGH_TOKEN' are symbolic floating-point constants.
6913 `GL_LINE_RESET_TOKEN' is returned whenever the line stipple pattern is
6914 reset. The data returned as a vertex depends on the feedback TYPE.
6916 The following table gives the correspondence between TYPE and the number
6917 of values per vertex. K is 1 in color index mode and 4 in RGBA mode.
6922 *Coordinates*, *Color*, *Texture*, *Total Number of Values*
6933 `GL_3D_COLOR_TEXTURE'
6934 X, Y, Z, K , 4 , 7+K
6936 `GL_4D_COLOR_TEXTURE'
6937 X, Y, Z, W, K , 4 , 8+K
6939 Feedback vertex coordinates are in window coordinates, except W, which
6940 is in clip coordinates. Feedback colors are lighted, if lighting is
6941 enabled. Feedback texture coordinates are generated, if texture
6942 coordinate generation is enabled. They are always transformed by the
6945 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
6947 `GL_INVALID_VALUE' is generated if SIZE is negative.
6949 `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
6950 while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
6951 with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
6954 `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is executed
6955 between the execution of `glBegin' and the corresponding execution of
6958 (define-gl-procedure
6959 ((glFinish -> void))
6960 "Block until all GL execution is complete.
6962 `glFinish' does not return until the effects of all previously called GL
6963 commands are complete. Such effects include all changes to GL state, all
6964 changes to connection state, and all changes to the frame buffer
6967 `GL_INVALID_OPERATION' is generated if `glFinish' is executed between
6968 the execution of `glBegin' and the corresponding execution of `glEnd'.")
6970 (define-gl-procedure
6972 "Force execution of GL commands in finite time.
6974 Different GL implementations buffer commands in several different
6975 locations, including network buffers and the graphics accelerator
6976 itself. `glFlush' empties all of these buffers, causing all issued
6977 commands to be executed as quickly as they are accepted by the actual
6978 rendering engine. Though this execution may not be completed in any
6979 particular time period, it does complete in finite time.
6981 Because any GL program might be executed over a network, or on an
6982 accelerator that buffers commands, all programs should call `glFlush'
6983 whenever they count on having all of their previously issued commands
6984 completed. For example, call `glFlush' before waiting for user input
6985 that depends on the generated image.
6987 `GL_INVALID_OPERATION' is generated if `glFlush' is executed between the
6988 execution of `glBegin' and the corresponding execution of `glEnd'.")
6990 (define-gl-procedure
6997 "Define an array of fog coordinates.
7000 Specifies the data type of each fog coordinate. Symbolic constants
7001 `GL_FLOAT', or `GL_DOUBLE' are accepted. The initial value is
7005 Specifies the byte offset between consecutive fog coordinates. If
7006 STRIDE is 0, the array elements are understood to be tightly
7007 packed. The initial value is 0.
7010 Specifies a pointer to the first coordinate of the first fog
7011 coordinate in the array. The initial value is 0.
7013 `glFogCoordPointer' specifies the location and data format of an array
7014 of fog coordinates to use when rendering. TYPE specifies the data type
7015 of each fog coordinate, and STRIDE specifies the byte stride from one
7016 fog coordinate to the next, allowing vertices and attributes to be
7017 packed into a single array or stored in separate arrays.
7019 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
7020 target (see `glBindBuffer') while a fog coordinate array is specified,
7021 POINTER is treated as a byte offset into the buffer object's data store.
7022 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
7023 fog coordinate vertex array client-side state
7024 (`GL_FOG_COORD_ARRAY_BUFFER_BINDING').
7026 When a fog coordinate array is specified, TYPE, STRIDE, and POINTER are
7027 saved as client-side state, in addition to the current vertex array
7028 buffer object binding.
7030 To enable and disable the fog coordinate array, call
7031 `glEnableClientState' and `glDisableClientState' with the argument
7032 `GL_FOG_COORD_ARRAY'. If enabled, the fog coordinate array is used when
7033 `glDrawArrays', `glMultiDrawArrays', `glDrawElements',
7034 `glMultiDrawElements', `glDrawRangeElements', or `glArrayElement' is
7037 `GL_INVALID_ENUM' is generated if TYPE is not either `GL_FLOAT' or
7040 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
7042 (define-gl-procedure
7043 ((glFogCoordd (coord GLdouble) -> void))
7044 "Set the current fog coordinates.
7047 Specify the fog distance.
7049 `glFogCoord' specifies the fog coordinate that is associated with each
7050 vertex and the current raster position. The value specified is
7051 interpolated and used in computing the fog color (see `glFog').")
7053 (define-gl-procedure
7054 ((glFogf (pname GLenum) (param GLfloat) -> void)
7055 (glFogi (pname GLenum) (param GLint) -> void))
7056 "Specify fog parameters.
7059 Specifies a single-valued fog parameter. `GL_FOG_MODE',
7060 `GL_FOG_DENSITY', `GL_FOG_START', `GL_FOG_END', `GL_FOG_INDEX', and
7061 `GL_FOG_COORD_SRC' are accepted.
7064 Specifies the value that PNAME will be set to.
7066 Fog is initially disabled. While enabled, fog affects rasterized
7067 geometry, bitmaps, and pixel blocks, but not buffer clear operations. To
7068 enable and disable fog, call `glEnable' and `glDisable' with argument
7071 `glFog' assigns the value or values in PARAMS to the fog parameter
7072 specified by PNAME. The following values are accepted for PNAME:
7075 PARAMS is a single integer or floating-point value that specifies
7076 the equation to be used to compute the fog blend factor, F . Three
7077 symbolic constants are accepted: `GL_LINEAR', `GL_EXP', and
7078 `GL_EXP2'. The equations corresponding to these symbolic constants
7079 are defined below. The initial fog mode is `GL_EXP'.
7082 PARAMS is a single integer or floating-point value that specifies
7083 DENSITY , the fog density used in both exponential fog equations.
7084 Only nonnegative densities are accepted. The initial fog density is
7088 PARAMS is a single integer or floating-point value that specifies
7089 START , the near distance used in the linear fog equation. The
7090 initial near distance is 0.
7093 PARAMS is a single integer or floating-point value that specifies
7094 END , the far distance used in the linear fog equation. The initial
7098 PARAMS is a single integer or floating-point value that specifies
7099 I_F , the fog color index. The initial fog index is 0.
7102 PARAMS contains four integer or floating-point values that specify
7103 C_F , the fog color. Integer values are mapped linearly such that
7104 the most positive representable value maps to 1.0, and the most
7105 negative representable value maps to -1.0 . Floating-point values
7106 are mapped directly. After conversion, all color components are
7107 clamped to the range [0,1] . The initial fog color is (0, 0, 0, 0).
7110 PARAMS contains either of the following symbolic constants:
7111 `GL_FOG_COORD' or `GL_FRAGMENT_DEPTH'. `GL_FOG_COORD' specifies
7112 that the current fog coordinate should be used as distance value in
7113 the fog color computation. `GL_FRAGMENT_DEPTH' specifies that the
7114 current fragment depth should be used as distance value in the fog
7117 Fog blends a fog color with each rasterized pixel fragment's
7118 post-texturing color using a blending factor F . Factor F is computed in
7119 one of three ways, depending on the fog mode. Let C be either the
7120 distance in eye coordinate from the origin (in the case that the
7121 `GL_FOG_COORD_SRC' is `GL_FRAGMENT_DEPTH') or the current fog coordinate
7122 (in the case that `GL_FOG_COORD_SRC' is `GL_FOG_COORD'). The equation
7123 for `GL_LINEAR' fog is F=END-C,/END-START,
7125 The equation for `GL_EXP' fog is F=E^-(DENSITY·C,),
7127 The equation for `GL_EXP2' fog is F=E^-(DENSITY·C,),^2
7129 Regardless of the fog mode, F is clamped to the range [0,1] after it is
7130 computed. Then, if the GL is in RGBA color mode, the fragment's red,
7131 green, and blue colors, represented by C_R , are replaced by
7133 C_R,^″=F×C_R+(1-F,)×C_F
7135 Fog does not affect a fragment's alpha component.
7137 In color index mode, the fragment's color index I_R is replaced by
7139 I_R,^″=I_R+(1-F,)×I_F
7143 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value, or if
7144 PNAME is `GL_FOG_MODE' and PARAMS is not an accepted value.
7146 `GL_INVALID_VALUE' is generated if PNAME is `GL_FOG_DENSITY' and PARAMS
7149 `GL_INVALID_OPERATION' is generated if `glFog' is executed between the
7150 execution of `glBegin' and the corresponding execution of `glEnd'.")
7152 (define-gl-procedure
7153 ((glFrontFace (mode GLenum) -> void))
7154 "Define front- and back-facing polygons.
7157 Specifies the orientation of front-facing polygons. `GL_CW' and
7158 `GL_CCW' are accepted. The initial value is `GL_CCW'.
7160 In a scene composed entirely of opaque closed surfaces, back-facing
7161 polygons are never visible. Eliminating these invisible polygons has the
7162 obvious benefit of speeding up the rendering of the image. To enable and
7163 disable elimination of back-facing polygons, call `glEnable' and
7164 `glDisable' with argument `GL_CULL_FACE'.
7166 The projection of a polygon to window coordinates is said to have
7167 clockwise winding if an imaginary object following the path from its
7168 first vertex, its second vertex, and so on, to its last vertex, and
7169 finally back to its first vertex, moves in a clockwise direction about
7170 the interior of the polygon. The polygon's winding is said to be
7171 counterclockwise if the imaginary object following the same path moves
7172 in a counterclockwise direction about the interior of the polygon.
7173 `glFrontFace' specifies whether polygons with clockwise winding in
7174 window coordinates, or counterclockwise winding in window coordinates,
7175 are taken to be front-facing. Passing `GL_CCW' to MODE selects
7176 counterclockwise polygons as front-facing; `GL_CW' selects clockwise
7177 polygons as front-facing. By default, counterclockwise polygons are
7178 taken to be front-facing.
7180 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
7182 `GL_INVALID_OPERATION' is generated if `glFrontFace' is executed between
7183 the execution of `glBegin' and the corresponding execution of `glEnd'.")
7185 (define-gl-procedure
7195 "Multiply the current matrix by a perspective matrix.
7200 Specify the coordinates for the left and right vertical clipping
7206 Specify the coordinates for the bottom and top horizontal clipping
7212 Specify the distances to the near and far depth clipping planes.
7213 Both distances must be positive.
7215 `glFrustum' describes a perspective matrix that produces a perspective
7216 projection. The current matrix (see `glMatrixMode') is multiplied by
7217 this matrix and the result replaces the current matrix, as if
7218 `glMultMatrix' were called with the following matrix as its argument:
7222 [(2\u2062NEARVAL,/RIGHT-LEFT,, 0 A 0), (0 2\u2062NEARVAL,/TOP-BOTTOM,, B 0), (0 0
7225 A=RIGHT+LEFT,/RIGHT-LEFT,
7227 B=TOP+BOTTOM,/TOP-BOTTOM,
7229 C=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
7231 D=-2\u2062FARVAL\u2062NEARVAL,/FARVAL-NEARVAL,,
7235 Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
7236 and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
7237 that are mapped to the lower left and upper right corners of the window,
7238 assuming that the eye is located at (0, 0, 0). -FARVAL specifies the
7239 location of the far clipping plane. Both NEARVAL and FARVAL must be
7242 Use `glPushMatrix' and `glPopMatrix' to save and restore the current
7245 `GL_INVALID_VALUE' is generated if NEARVAL or FARVAL is not positive, or
7246 if LEFT = RIGHT, or BOTTOM = TOP, or NEAR = FAR.
7248 `GL_INVALID_OPERATION' is generated if `glFrustum' is executed between
7249 the execution of `glBegin' and the corresponding execution of `glEnd'.")
7251 (define-gl-procedure
7252 ((glGenBuffers (n GLsizei) (buffers *) -> void))
7253 "Generate buffer object names.
7256 Specifies the number of buffer object names to be generated.
7259 Specifies an array in which the generated buffer object names are
7262 `glGenBuffers' returns N buffer object names in BUFFERS. There is no
7263 guarantee that the names form a contiguous set of integers; however, it
7264 is guaranteed that none of the returned names was in use immediately
7265 before the call to `glGenBuffers'.
7267 Buffer object names returned by a call to `glGenBuffers' are not
7268 returned by subsequent calls, unless they are first deleted with
7271 No buffer objects are associated with the returned buffer object names
7272 until they are first bound by calling `glBindBuffer'.
7274 `GL_INVALID_VALUE' is generated if N is negative.
7276 `GL_INVALID_OPERATION' is generated if `glGenBuffers' is executed
7277 between the execution of `glBegin' and the corresponding execution of
7280 (define-gl-procedure
7281 ((glGenLists (range GLsizei) -> GLuint))
7282 "Generate a contiguous set of empty display lists.
7285 Specifies the number of contiguous empty display lists to be
7288 `glGenLists' has one argument, RANGE. It returns an integer N such that
7289 RANGE contiguous empty display lists, named N , N+1 , ... , N+RANGE-1 ,
7290 are created. If RANGE is 0, if there is no group of RANGE contiguous
7291 names available, or if any error is generated, no display lists are
7292 generated, and 0 is returned.
7294 `GL_INVALID_VALUE' is generated if RANGE is negative.
7296 `GL_INVALID_OPERATION' is generated if `glGenLists' is executed between
7297 the execution of `glBegin' and the corresponding execution of `glEnd'.")
7299 (define-gl-procedure
7300 ((glGenQueries (n GLsizei) (ids *) -> void))
7301 "Generate query object names.
7304 Specifies the number of query object names to be generated.
7307 Specifies an array in which the generated query object names are
7310 `glGenQueries' returns N query object names in IDS. There is no
7311 guarantee that the names form a contiguous set of integers; however, it
7312 is guaranteed that none of the returned names was in use immediately
7313 before the call to `glGenQueries'.
7315 Query object names returned by a call to `glGenQueries' are not returned
7316 by subsequent calls, unless they are first deleted with
7319 No query objects are associated with the returned query object names
7320 until they are first used by calling `glBeginQuery'.
7322 `GL_INVALID_VALUE' is generated if N is negative.
7324 `GL_INVALID_OPERATION' is generated if `glGenQueries' is executed
7325 between the execution of `glBegin' and the corresponding execution of
7328 (define-gl-procedure
7329 ((glGenTextures (n GLsizei) (textures *) -> void))
7330 "Generate texture names.
7333 Specifies the number of texture names to be generated.
7336 Specifies an array in which the generated texture names are stored.
7338 `glGenTextures' returns N texture names in TEXTURES. There is no
7339 guarantee that the names form a contiguous set of integers; however, it
7340 is guaranteed that none of the returned names was in use immediately
7341 before the call to `glGenTextures'.
7343 The generated textures have no dimensionality; they assume the
7344 dimensionality of the texture target to which they are first bound (see
7347 Texture names returned by a call to `glGenTextures' are not returned by
7348 subsequent calls, unless they are first deleted with `glDeleteTextures'.
7350 `GL_INVALID_VALUE' is generated if N is negative.
7352 `GL_INVALID_OPERATION' is generated if `glGenTextures' is executed
7353 between the execution of `glBegin' and the corresponding execution of
7356 (define-gl-procedure
7367 "Returns information about an active attribute variable for the specified
7371 Specifies the program object to be queried.
7374 Specifies the index of the attribute variable to be queried.
7377 Specifies the maximum number of characters OpenGL is allowed to
7378 write in the character buffer indicated by NAME.
7381 Returns the number of characters actually written by OpenGL in the
7382 string indicated by NAME (excluding the null terminator) if a value
7383 other than `NULL' is passed.
7386 Returns the size of the attribute variable.
7389 Returns the data type of the attribute variable.
7392 Returns a null terminated string containing the name of the
7395 `glGetActiveAttrib' returns information about an active attribute
7396 variable in the program object specified by PROGRAM. The number of
7397 active attributes can be obtained by calling `glGetProgram' with the
7398 value `GL_ACTIVE_ATTRIBUTES'. A value of 0 for INDEX selects the first
7399 active attribute variable. Permissible values for INDEX range from 0 to
7400 the number of active attribute variables minus 1.
7402 A vertex shader may use either built-in attribute variables,
7403 user-defined attribute variables, or both. Built-in attribute variables
7404 have a prefix of \"gl_\" and reference conventional OpenGL vertex
7405 attribtes (e.g., GL_VERTEX, GL_NORMAL, etc., see the OpenGL Shading
7406 Language specification for a complete list.) User-defined attribute
7407 variables have arbitrary names and obtain their values through numbered
7408 generic vertex attributes. An attribute variable (either built-in or
7409 user-defined) is considered active if it is determined during the link
7410 operation that it may be accessed during program execution. Therefore,
7411 PROGRAM should have previously been the target of a call to
7412 `glLinkProgram', but it is not necessary for it to have been linked
7415 The size of the character buffer required to store the longest attribute
7416 variable name in PROGRAM can be obtained by calling `glGetProgram' with
7417 the value `GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'. This value should be used to
7418 allocate a buffer of sufficient size to store the returned attribute
7419 name. The size of this character buffer is passed in BUFSIZE, and a
7420 pointer to this character buffer is passed in NAME.
7422 `glGetActiveAttrib' returns the name of the attribute variable indicated
7423 by INDEX, storing it in the character buffer specified by NAME. The
7424 string returned will be null terminated. The actual number of characters
7425 written into this buffer is returned in LENGTH, and this count does not
7426 include the null termination character. If the length of the returned
7427 string is not required, a value of `NULL' can be passed in the LENGTH
7430 The TYPE argument will return a pointer to the attribute variable's data
7431 type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7432 `GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3',
7433 `GL_FLOAT_MAT4', `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4',
7434 `GL_FLOAT_MAT3x2', `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', or
7435 `GL_FLOAT_MAT4x3' may be returned. The SIZE argument will return the
7436 size of the attribute, in units of the type returned in TYPE.
7438 The list of active attribute variables may include both built-in
7439 attribute variables (which begin with the prefix \"gl_\") as well as
7440 user-defined attribute variable names.
7442 This function will return as much information as it can about the
7443 specified active attribute variable. If no information is available,
7444 LENGTH will be 0, and NAME will be an empty string. This situation could
7445 occur if this function is called after a link operation that failed. If
7446 an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7449 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7452 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7454 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7455 number of active attribute variables in PROGRAM.
7457 `GL_INVALID_OPERATION' is generated if `glGetActiveAttrib' is executed
7458 between the execution of `glBegin' and the corresponding execution of
7461 `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7463 (define-gl-procedure
7464 ((glGetActiveUniform
7474 "Returns information about an active uniform variable for the specified
7478 Specifies the program object to be queried.
7481 Specifies the index of the uniform variable to be queried.
7484 Specifies the maximum number of characters OpenGL is allowed to
7485 write in the character buffer indicated by NAME.
7488 Returns the number of characters actually written by OpenGL in the
7489 string indicated by NAME (excluding the null terminator) if a value
7490 other than `NULL' is passed.
7493 Returns the size of the uniform variable.
7496 Returns the data type of the uniform variable.
7499 Returns a null terminated string containing the name of the uniform
7502 `glGetActiveUniform' returns information about an active uniform
7503 variable in the program object specified by PROGRAM. The number of
7504 active uniform variables can be obtained by calling `glGetProgram' with
7505 the value `GL_ACTIVE_UNIFORMS'. A value of 0 for INDEX selects the first
7506 active uniform variable. Permissible values for INDEX range from 0 to
7507 the number of active uniform variables minus 1.
7509 Shaders may use either built-in uniform variables, user-defined uniform
7510 variables, or both. Built-in uniform variables have a prefix of \"gl_\"
7511 and reference existing OpenGL state or values derived from such state
7512 (e.g., GL_FOG, GL_MODELVIEWMATRIX, etc., see the OpenGL Shading Language
7513 specification for a complete list.) User-defined uniform variables have
7514 arbitrary names and obtain their values from the application through
7515 calls to `glUniform'. A uniform variable (either built-in or
7516 user-defined) is considered active if it is determined during the link
7517 operation that it may be accessed during program execution. Therefore,
7518 PROGRAM should have previously been the target of a call to
7519 `glLinkProgram', but it is not necessary for it to have been linked
7522 The size of the character buffer required to store the longest uniform
7523 variable name in PROGRAM can be obtained by calling `glGetProgram' with
7524 the value `GL_ACTIVE_UNIFORM_MAX_LENGTH'. This value should be used to
7525 allocate a buffer of sufficient size to store the returned uniform
7526 variable name. The size of this character buffer is passed in BUFSIZE,
7527 and a pointer to this character buffer is passed in NAME.
7529 `glGetActiveUniform' returns the name of the uniform variable indicated
7530 by INDEX, storing it in the character buffer specified by NAME. The
7531 string returned will be null terminated. The actual number of characters
7532 written into this buffer is returned in LENGTH, and this count does not
7533 include the null termination character. If the length of the returned
7534 string is not required, a value of `NULL' can be passed in the LENGTH
7537 The TYPE argument will return a pointer to the uniform variable's data
7538 type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7539 `GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_INT', `GL_INT_VEC2',
7540 `GL_INT_VEC3', `GL_INT_VEC4', `GL_BOOL', `GL_BOOL_VEC2', `GL_BOOL_VEC3',
7541 `GL_BOOL_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3', `GL_FLOAT_MAT4',
7542 `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4', `GL_FLOAT_MAT3x2',
7543 `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', `GL_FLOAT_MAT4x3',
7544 `GL_SAMPLER_1D', `GL_SAMPLER_2D', `GL_SAMPLER_3D', `GL_SAMPLER_CUBE',
7545 `GL_SAMPLER_1D_SHADOW', or `GL_SAMPLER_2D_SHADOW' may be returned.
7547 If one or more elements of an array are active, the name of the array is
7548 returned in NAME, the type is returned in TYPE, and the SIZE parameter
7549 returns the highest array element index used, plus one, as determined by
7550 the compiler and/or linker. Only one active uniform variable will be
7551 reported for a uniform array.
7553 Uniform variables that are declared as structures or arrays of
7554 structures will not be returned directly by this function. Instead, each
7555 of these uniform variables will be reduced to its fundamental components
7556 containing the \".\" and \"[]\" operators such that each of the names is
7557 valid as an argument to `glGetUniformLocation'. Each of these reduced
7558 uniform variables is counted as one active uniform variable and is
7559 assigned an index. A valid name cannot be a structure, an array of
7560 structures, or a subcomponent of a vector or matrix.
7562 The size of the uniform variable will be returned in SIZE. Uniform
7563 variables other than arrays will have a size of 1. Structures and arrays
7564 of structures will be reduced as described earlier, such that each of
7565 the names returned will be a data type in the earlier list. If this
7566 reduction results in an array, the size returned will be as described
7567 for uniform arrays; otherwise, the size returned will be 1.
7569 The list of active uniform variables may include both built-in uniform
7570 variables (which begin with the prefix \"gl_\") as well as user-defined
7571 uniform variable names.
7573 This function will return as much information as it can about the
7574 specified active uniform variable. If no information is available,
7575 LENGTH will be 0, and NAME will be an empty string. This situation could
7576 occur if this function is called after a link operation that failed. If
7577 an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7580 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7583 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7585 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7586 number of active uniform variables in PROGRAM.
7588 `GL_INVALID_OPERATION' is generated if `glGetActiveUniform' is executed
7589 between the execution of `glBegin' and the corresponding execution of
7592 `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7594 (define-gl-procedure
7595 ((glGetAttachedShaders
7602 "Returns the handles of the shader objects attached to a program object.
7605 Specifies the program object to be queried.
7608 Specifies the size of the array for storing the returned object
7612 Returns the number of names actually returned in OBJECTS.
7615 Specifies an array that is used to return the names of attached
7618 `glGetAttachedShaders' returns the names of the shader objects attached
7619 to PROGRAM. The names of shader objects that are attached to PROGRAM
7620 will be returned in SHADERS. The actual number of shader names written
7621 into SHADERS is returned in COUNT. If no shader objects are attached to
7622 PROGRAM, COUNT is set to 0. The maximum number of shader names that may
7623 be returned in SHADERS is specified by MAXCOUNT.
7625 If the number of names actually returned is not required (for instance,
7626 if it has just been obtained by calling `glGetProgram'), a value of
7627 `NULL' may be passed for count. If no shader objects are attached to
7628 PROGRAM, a value of 0 will be returned in COUNT. The actual number of
7629 attached shaders can be obtained by calling `glGetProgram' with the
7630 value `GL_ATTACHED_SHADERS'.
7632 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7635 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7637 `GL_INVALID_VALUE' is generated if MAXCOUNT is less than 0.
7639 `GL_INVALID_OPERATION' is generated if `glGetAttachedShaders' is
7640 executed between the execution of `glBegin' and the corresponding
7641 execution of `glEnd'.")
7643 (define-gl-procedure
7644 ((glGetAttribLocation
7649 "Returns the location of an attribute variable.
7652 Specifies the program object to be queried.
7655 Points to a null terminated string containing the name of the
7656 attribute variable whose location is to be queried.
7658 `glGetAttribLocation' queries the previously linked program object
7659 specified by PROGRAM for the attribute variable specified by NAME and
7660 returns the index of the generic vertex attribute that is bound to that
7661 attribute variable. If NAME is a matrix attribute variable, the index of
7662 the first column of the matrix is returned. If the named attribute
7663 variable is not an active attribute in the specified program object or
7664 if NAME starts with the reserved prefix \"gl_\", a value of -1 is
7667 The association between an attribute variable name and a generic
7668 attribute index can be specified at any time by calling
7669 `glBindAttribLocation'. Attribute bindings do not go into effect until
7670 `glLinkProgram' is called. After a program object has been linked
7671 successfully, the index values for attribute variables remain fixed
7672 until the next link command occurs. The attribute values can only be
7673 queried after a link if the link was successful. `glGetAttribLocation'
7674 returns the binding that actually went into effect the last time
7675 `glLinkProgram' was called for the specified program object. Attribute
7676 bindings that have been specified since the last link operation are not
7677 returned by `glGetAttribLocation'.
7679 `GL_INVALID_OPERATION' is generated if PROGRAM is not a value generated
7682 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7684 `GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
7687 `GL_INVALID_OPERATION' is generated if `glGetAttribLocation' is executed
7688 between the execution of `glBegin' and the corresponding execution of
7691 (define-gl-procedure
7692 ((glGetBufferSubData
7699 "Returns a subset of a buffer object's data store.
7702 Specifies the target buffer object. The symbolic constant must be
7703 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
7704 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
7707 Specifies the offset into the buffer object's data store from which
7708 data will be returned, measured in bytes.
7711 Specifies the size in bytes of the data store region being
7715 Specifies a pointer to the location where buffer object data is
7718 `glGetBufferSubData' returns some or all of the data from the buffer
7719 object currently bound to TARGET. Data starting at byte offset OFFSET
7720 and extending for SIZE bytes is copied from the data store to the memory
7721 pointed to by DATA. An error is thrown if the buffer object is currently
7722 mapped, or if OFFSET and SIZE together define a range beyond the bounds
7723 of the buffer object's data store.
7725 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
7726 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
7727 `GL_PIXEL_UNPACK_BUFFER'.
7729 `GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
7730 together they define a region of memory that extends beyond the buffer
7731 object's allocated data store.
7733 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
7736 `GL_INVALID_OPERATION' is generated if the buffer object being queried
7739 `GL_INVALID_OPERATION' is generated if `glGetBufferSubData' is executed
7740 between the execution of `glBegin' and the corresponding execution of
7743 (define-gl-procedure
7749 "Return the coefficients of the specified clipping plane.
7752 Specifies a clipping plane. The number of clipping planes depends
7753 on the implementation, but at least six clipping planes are
7754 supported. They are identified by symbolic names of the form
7755 `GL_CLIP_PLANE' I where i ranges from 0 to the value of
7756 `GL_MAX_CLIP_PLANES' - 1.
7759 Returns four double-precision values that are the coefficients of
7760 the plane equation of PLANE in eye coordinates. The initial value
7763 `glGetClipPlane' returns in EQUATION the four coefficients of the plane
7766 `GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
7768 `GL_INVALID_OPERATION' is generated if `glGetClipPlane' is executed
7769 between the execution of `glBegin' and the corresponding execution of
7772 (define-gl-procedure
7780 "Retrieve contents of a color lookup table.
7783 Must be `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
7784 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
7787 The format of the pixel data in TABLE. The possible values are
7788 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
7789 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
7792 The type of the pixel data in TABLE. Symbolic constants
7793 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
7794 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
7795 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
7796 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
7797 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
7798 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
7799 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
7800 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
7804 Pointer to a one-dimensional array of pixel data containing the
7805 contents of the color table.
7807 `glGetColorTable' returns in TABLE the contents of the color table
7808 specified by TARGET. No pixel transfer operations are performed, but
7809 pixel storage modes that are applicable to `glReadPixels' are performed.
7811 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
7812 target (see `glBindBuffer') while a histogram table is requested, TABLE
7813 is treated as a byte offset into the buffer object's data store.
7815 Color components that are requested in the specified FORMAT, but which
7816 are not included in the internal format of the color lookup table, are
7817 returned as zero. The assignments of internal color components to the
7818 components requested by FORMAT are
7820 *Internal Component*
7821 *Resulting Component*
7843 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
7846 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
7849 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
7852 `GL_INVALID_OPERATION' is generated if TYPE is one of
7853 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
7854 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
7857 `GL_INVALID_OPERATION' is generated if TYPE is one of
7858 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
7859 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
7860 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
7861 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
7862 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
7864 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7865 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
7866 store is currently mapped.
7868 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7869 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
7870 to the buffer object such that the memory writes required would exceed
7871 the data store size.
7873 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7874 bound to the `GL_PIXEL_PACK_BUFFER' target and TABLE is not evenly
7875 divisible into the number of bytes needed to store in memory a datum
7878 `GL_INVALID_OPERATION' is generated if `glGetColorTable' is executed
7879 between the execution of `glBegin' and the corresponding execution of
7882 (define-gl-procedure
7883 ((glGetCompressedTexImage
7889 "Return a compressed texture image.
7892 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
7893 `GL_TEXTURE_2D', and
7894 `GL_TEXTURE_3D'`GL_TEXTURE_CUBE_MAP_POSITIVE_X',
7895 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
7896 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
7897 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
7900 Specifies the level-of-detail number of the desired image. Level 0
7901 is the base image level. Level N is the N th mipmap reduction
7905 Returns the compressed texture image.
7907 `glGetCompressedTexImage' returns the compressed texture image
7908 associated with TARGET and LOD into IMG. IMG should be an array of
7909 `GL_TEXTURE_COMPRESSED_IMAGE_SIZE' bytes. TARGET specifies whether the
7910 desired texture image was one specified by `glTexImage1D'
7911 (`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
7912 `GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LOD
7913 specifies the level-of-detail number of the desired image.
7915 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
7916 target (see `glBindBuffer') while a texture image is requested, IMG is
7917 treated as a byte offset into the buffer object's data store.
7919 To minimize errors, first verify that the texture is compressed by
7920 calling `glGetTexLevelParameter' with argument `GL_TEXTURE_COMPRESSED'.
7921 If the texture is compressed, then determine the amount of memory
7922 required to store the compressed texture by calling
7923 `glGetTexLevelParameter' with argument
7924 `GL_TEXTURE_COMPRESSED_IMAGE_SIZE'. Finally, retrieve the internal
7925 format of the texture by calling `glGetTexLevelParameter' with argument
7926 `GL_TEXTURE_INTERNAL_FORMAT'. To store the texture for later use,
7927 associate the internal format and size with the retrieved texture image.
7928 These data can be used by the respective texture or subtexture loading
7929 routine used for loading TARGET textures.
7931 `GL_INVALID_VALUE' is generated if LOD is less than zero or greater than
7932 the maximum number of LODs permitted by the implementation.
7934 `GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is used
7935 to retrieve a texture that is in an uncompressed internal format.
7937 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7938 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
7939 store is currently mapped.
7941 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7942 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
7943 to the buffer object such that the memory writes required would exceed
7944 the data store size.
7946 `GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is
7947 executed between the execution of `glBegin' and the corresponding
7948 execution of `glEnd'.")
7950 (define-gl-procedure
7951 ((glGetConvolutionFilter
7958 "Get current 1D or 2D convolution filter kernel.
7961 The filter to be retrieved. Must be one of `GL_CONVOLUTION_1D' or
7962 `GL_CONVOLUTION_2D'.
7965 Format of the output image. Must be one of `GL_RED', `GL_GREEN',
7966 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
7967 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
7970 Data type of components in the output image. Symbolic constants
7971 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
7972 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
7973 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
7974 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
7975 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
7976 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
7977 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
7978 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
7982 Pointer to storage for the output image.
7984 `glGetConvolutionFilter' returns the current 1D or 2D convolution filter
7985 kernel as an image. The one- or two-dimensional image is placed in IMAGE
7986 according to the specifications in FORMAT and TYPE. No pixel transfer
7987 operations are performed on this image, but the relevant pixel storage
7990 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
7991 target (see `glBindBuffer') while a convolution filter is requested,
7992 IMAGE is treated as a byte offset into the buffer object's data store.
7994 Color components that are present in FORMAT but not included in the
7995 internal format of the filter are returned as zero. The assignments of
7996 internal color components to the components of FORMAT are as follows.
7998 *Internal Component*
7999 *Resulting Component*
8021 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8024 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8027 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8030 `GL_INVALID_OPERATION' is generated if TYPE is one of
8031 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8032 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8035 `GL_INVALID_OPERATION' is generated if TYPE is one of
8036 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8037 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8038 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8039 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8040 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8042 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8043 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8044 store is currently mapped.
8046 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8047 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8048 to the buffer object such that the memory writes required would exceed
8049 the data store size.
8051 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8052 bound to the `GL_PIXEL_PACK_BUFFER' target and IMAGE is not evenly
8053 divisible into the number of bytes needed to store in memory a datum
8056 `GL_INVALID_OPERATION' is generated if `glGetConvolutionFilter' is
8057 executed between the execution of `glBegin' and the corresponding
8058 execution of `glEnd'.")
8060 (define-gl-procedure
8061 ((glGetError -> GLenum))
8062 "Return error information.
8064 `glGetError' returns the value of the error flag. Each detectable error
8065 is assigned a numeric code and symbolic name. When an error occurs, the
8066 error flag is set to the appropriate error code value. No other errors
8067 are recorded until `glGetError' is called, the error code is returned,
8068 and the flag is reset to `GL_NO_ERROR'. If a call to `glGetError'
8069 returns `GL_NO_ERROR', there has been no detectable error since the last
8070 call to `glGetError', or since the GL was initialized.
8072 To allow for distributed implementations, there may be several error
8073 flags. If any single error flag has recorded an error, the value of that
8074 flag is returned and that flag is reset to `GL_NO_ERROR' when
8075 `glGetError' is called. If more than one flag has recorded an error,
8076 `glGetError' returns and clears an arbitrary error flag value. Thus,
8077 `glGetError' should always be called in a loop, until it returns
8078 `GL_NO_ERROR', if all error flags are to be reset.
8080 Initially, all error flags are set to `GL_NO_ERROR'.
8082 The following errors are currently defined:
8085 No error has been recorded. The value of this symbolic constant is
8089 An unacceptable value is specified for an enumerated argument. The
8090 offending command is ignored and has no other side effect than to
8094 A numeric argument is out of range. The offending command is
8095 ignored and has no other side effect than to set the error flag.
8097 `GL_INVALID_OPERATION'
8098 The specified operation is not allowed in the current state. The
8099 offending command is ignored and has no other side effect than to
8103 This command would cause a stack overflow. The offending command is
8104 ignored and has no other side effect than to set the error flag.
8106 `GL_STACK_UNDERFLOW'
8107 This command would cause a stack underflow. The offending command
8108 is ignored and has no other side effect than to set the error flag.
8111 There is not enough memory left to execute the command. The state
8112 of the GL is undefined, except for the state of the error flags,
8113 after this error is recorded.
8115 `GL_TABLE_TOO_LARGE'
8116 The specified table exceeds the implementation's maximum supported
8117 table size. The offending command is ignored and has no other side
8118 effect than to set the error flag.
8120 When an error flag is set, results of a GL operation are undefined only
8121 if `GL_OUT_OF_MEMORY' has occurred. In all other cases, the command
8122 generating the error is ignored and has no effect on the GL state or
8123 frame buffer contents. If the generating command returns a value, it
8124 returns 0. If `glGetError' itself generates an error, it returns 0.
8126 `GL_INVALID_OPERATION' is generated if `glGetError' is executed between
8127 the execution of `glBegin' and the corresponding execution of `glEnd'.
8128 In this case, `glGetError' returns 0.")
8130 (define-gl-procedure
8139 "Get histogram table.
8142 Must be `GL_HISTOGRAM'.
8145 If `GL_TRUE', each component counter that is actually returned is
8146 reset to zero. (Other counters are unaffected.) If `GL_FALSE', none
8147 of the counters in the histogram table is modified.
8150 The format of values to be returned in VALUES. Must be one of
8151 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
8152 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8155 The type of values to be returned in VALUES. Symbolic constants
8156 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8157 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8158 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8159 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8160 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8161 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8162 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8163 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8167 A pointer to storage for the returned histogram table.
8169 `glGetHistogram' returns the current histogram table as a
8170 one-dimensional image with the same width as the histogram. No pixel
8171 transfer operations are performed on this image, but pixel storage modes
8172 that are applicable to 1D images are honored.
8174 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8175 target (see `glBindBuffer') while a histogram table is requested, VALUES
8176 is treated as a byte offset into the buffer object's data store.
8178 Color components that are requested in the specified FORMAT, but which
8179 are not included in the internal format of the histogram, are returned
8180 as zero. The assignments of internal color components to the components
8181 requested by FORMAT are:
8183 *Internal Component*
8184 *Resulting Component*
8203 `GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
8205 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8208 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8211 `GL_INVALID_OPERATION' is generated if TYPE is one of
8212 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8213 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8216 `GL_INVALID_OPERATION' is generated if TYPE is one of
8217 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8218 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8219 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8220 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8221 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8223 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8224 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8225 store is currently mapped.
8227 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8228 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8229 to the buffer object such that the memory writes required would exceed
8230 the data store size.
8232 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8233 bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
8234 divisible into the number of bytes needed to store in memory a datum
8237 `GL_INVALID_OPERATION' is generated if `glGetHistogram' is executed
8238 between the execution of `glBegin' and the corresponding execution of
8241 (define-gl-procedure
8250 "Get minimum and maximum pixel values.
8253 Must be `GL_MINMAX'.
8256 If `GL_TRUE', all entries in the minmax table that are actually
8257 returned are reset to their initial values. (Other entries are
8258 unaltered.) If `GL_FALSE', the minmax table is unaltered.
8261 The format of the data to be returned in VALUES. Must be one of
8262 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
8263 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8266 The type of the data to be returned in VALUES. Symbolic constants
8267 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8268 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8269 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8270 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8271 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8272 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8273 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8274 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8278 A pointer to storage for the returned values.
8280 `glGetMinmax' returns the accumulated minimum and maximum pixel values
8281 (computed on a per-component basis) in a one-dimensional image of width
8282 2. The first set of return values are the minima, and the second set of
8283 return values are the maxima. The format of the return values is
8284 determined by FORMAT, and their type is determined by TYPES.
8286 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8287 target (see `glBindBuffer') while minimum and maximum pixel values are
8288 requested, VALUES is treated as a byte offset into the buffer object's
8291 No pixel transfer operations are performed on the return values, but
8292 pixel storage modes that are applicable to one-dimensional images are
8293 performed. Color components that are requested in the specified FORMAT,
8294 but that are not included in the internal format of the minmax table,
8295 are returned as zero. The assignment of internal color components to the
8296 components requested by FORMAT are as follows:
8300 *Internal Component*
8301 *Resulting Component*
8318 If RESET is `GL_TRUE', the minmax table entries corresponding to the
8319 return values are reset to their initial values. Minimum and maximum
8320 values that are not returned are not modified, even if RESET is
8323 `GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
8325 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8328 `GL_INVALID_ENUM' is generated if TYPES is not one of the allowable
8331 `GL_INVALID_OPERATION' is generated if TYPES is one of
8332 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8333 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8336 `GL_INVALID_OPERATION' is generated if TYPES is one of
8337 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8338 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8339 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8340 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8341 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8343 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8344 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8345 store is currently mapped.
8347 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8348 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8349 to the buffer object such that the memory writes required would exceed
8350 the data store size.
8352 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8353 bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
8354 divisible into the number of bytes needed to store in memory a datum
8357 `GL_INVALID_OPERATION' is generated if `glGetMinmax' is executed between
8358 the execution of `glBegin' and the corresponding execution of `glEnd'.")
8360 (define-gl-procedure
8361 ((glGetPolygonStipple (pattern *) -> void))
8362 "Return the polygon stipple pattern.
8365 Returns the stipple pattern. The initial value is all 1's.
8367 `glGetPolygonStipple' returns to PATTERN a 32×32 polygon stipple
8368 pattern. The pattern is packed into memory as if `glReadPixels' with
8369 both HEIGHT and WIDTH of 32, TYPE of `GL_BITMAP', and FORMAT of
8370 `GL_COLOR_INDEX' were called, and the stipple pattern were stored in an
8371 internal 32×32 color index buffer. Unlike `glReadPixels', however, pixel
8372 transfer operations (shift, offset, pixel map) are not applied to the
8373 returned stipple image.
8375 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8376 target (see `glBindBuffer') while a polygon stipple pattern is
8377 requested, PATTERN is treated as a byte offset into the buffer object's
8380 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8381 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8382 store is currently mapped.
8384 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8385 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8386 to the buffer object such that the memory writes required would exceed
8387 the data store size.
8389 `GL_INVALID_OPERATION' is generated if `glGetPolygonStipple' is executed
8390 between the execution of `glBegin' and the corresponding execution of
8393 (define-gl-procedure
8394 ((glGetProgramInfoLog
8401 "Returns the information log for a program object.
8404 Specifies the program object whose information log is to be
8408 Specifies the size of the character buffer for storing the returned
8412 Returns the length of the string returned in INFOLOG (excluding the
8416 Specifies an array of characters that is used to return the
8419 `glGetProgramInfoLog' returns the information log for the specified
8420 program object. The information log for a program object is modified
8421 when the program object is linked or validated. The string that is
8422 returned will be null terminated.
8424 `glGetProgramInfoLog' returns in INFOLOG as much of the information log
8425 as it can, up to a maximum of MAXLENGTH characters. The number of
8426 characters actually returned, excluding the null termination character,
8427 is specified by LENGTH. If the length of the returned string is not
8428 required, a value of `NULL' can be passed in the LENGTH argument. The
8429 size of the buffer required to store the returned information log can be
8430 obtained by calling `glGetProgram' with the value `GL_INFO_LOG_LENGTH'.
8432 The information log for a program object is either an empty string, or a
8433 string containing information about the last link operation, or a string
8434 containing information about the last validation operation. It may
8435 contain diagnostic messages, warning messages, and other information.
8436 When a program object is created, its information log will be a string
8439 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
8442 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
8444 `GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
8446 `GL_INVALID_OPERATION' is generated if `glGetProgramInfoLog' is executed
8447 between the execution of `glBegin' and the corresponding execution of
8450 (define-gl-procedure
8451 ((glGetSeparableFilter
8460 "Get separable convolution filter kernel images.
8463 The separable filter to be retrieved. Must be `GL_SEPARABLE_2D'.
8466 Format of the output images. Must be one of `GL_RED', `GL_GREEN',
8467 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR'`GL_RGBA', `GL_BGRA',
8468 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8471 Data type of components in the output images. Symbolic constants
8472 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8473 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8474 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8475 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8476 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8477 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8478 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8479 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8483 Pointer to storage for the row filter image.
8486 Pointer to storage for the column filter image.
8489 Pointer to storage for the span filter image (currently unused).
8491 `glGetSeparableFilter' returns the two one-dimensional filter kernel
8492 images for the current separable 2D convolution filter. The row image is
8493 placed in ROW and the column image is placed in COLUMN according to the
8494 specifications in FORMAT and TYPE. (In the current implementation, SPAN
8495 is not affected in any way.) No pixel transfer operations are performed
8496 on the images, but the relevant pixel storage modes are applied.
8498 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8499 target (see `glBindBuffer') while a separable convolution filter is
8500 requested, ROW, COLUMN, and SPAN are treated as a byte offset into the
8501 buffer object's data store.
8503 Color components that are present in FORMAT but not included in the
8504 internal format of the filters are returned as zero. The assignments of
8505 internal color components to the components of FORMAT are as follows:
8509 *Internal Component*
8510 *Resulting Component*
8532 `GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
8534 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8537 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8540 `GL_INVALID_OPERATION' is generated if TYPE is one of
8541 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8542 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8545 `GL_INVALID_OPERATION' is generated if TYPE is one of
8546 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8547 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8548 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8549 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8550 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8552 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8553 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8554 store is currently mapped.
8556 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8557 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8558 to the buffer object such that the memory writes required would exceed
8559 the data store size.
8561 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8562 bound to the `GL_PIXEL_PACK_BUFFER' target and ROW or COLUMN is not
8563 evenly divisible into the number of bytes needed to store in memory a
8564 datum indicated by TYPE.
8566 `GL_INVALID_OPERATION' is generated if `glGetSeparableFilter' is
8567 executed between the execution of `glBegin' and the corresponding
8568 execution of `glEnd'.")
8570 (define-gl-procedure
8571 ((glGetShaderInfoLog
8578 "Returns the information log for a shader object.
8581 Specifies the shader object whose information log is to be queried.
8584 Specifies the size of the character buffer for storing the returned
8588 Returns the length of the string returned in INFOLOG (excluding the
8592 Specifies an array of characters that is used to return the
8595 `glGetShaderInfoLog' returns the information log for the specified
8596 shader object. The information log for a shader object is modified when
8597 the shader is compiled. The string that is returned will be null
8600 `glGetShaderInfoLog' returns in INFOLOG as much of the information log
8601 as it can, up to a maximum of MAXLENGTH characters. The number of
8602 characters actually returned, excluding the null termination character,
8603 is specified by LENGTH. If the length of the returned string is not
8604 required, a value of `NULL' can be passed in the LENGTH argument. The
8605 size of the buffer required to store the returned information log can be
8606 obtained by calling `glGetShader' with the value `GL_INFO_LOG_LENGTH'.
8608 The information log for a shader object is a string that may contain
8609 diagnostic messages, warning messages, and other information about the
8610 last compile operation. When a shader object is created, its information
8611 log will be a string of length 0.
8613 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
8616 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
8618 `GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
8620 `GL_INVALID_OPERATION' is generated if `glGetShaderInfoLog' is executed
8621 between the execution of `glBegin' and the corresponding execution of
8624 (define-gl-procedure
8632 "Returns the source code string from a shader object.
8635 Specifies the shader object to be queried.
8638 Specifies the size of the character buffer for storing the returned
8642 Returns the length of the string returned in SOURCE (excluding the
8646 Specifies an array of characters that is used to return the source
8649 `glGetShaderSource' returns the concatenation of the source code strings
8650 from the shader object specified by SHADER. The source code strings for
8651 a shader object are the result of a previous call to `glShaderSource'.
8652 The string returned by the function will be null terminated.
8654 `glGetShaderSource' returns in SOURCE as much of the source code string
8655 as it can, up to a maximum of BUFSIZE characters. The number of
8656 characters actually returned, excluding the null termination character,
8657 is specified by LENGTH. If the length of the returned string is not
8658 required, a value of `NULL' can be passed in the LENGTH argument. The
8659 size of the buffer required to store the returned source code string can
8660 be obtained by calling `glGetShader' with the value
8661 `GL_SHADER_SOURCE_LENGTH'.
8663 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
8666 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
8668 `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.
8670 `GL_INVALID_OPERATION' is generated if `glGetShaderSource' is executed
8671 between the execution of `glBegin' and the corresponding execution of
8674 (define-gl-procedure
8675 ((glGetString (name GLenum) -> *))
8676 "Return a string describing the current GL connection.
8679 Specifies a symbolic constant, one of `GL_VENDOR', `GL_RENDERER',
8680 `GL_VERSION', `GL_SHADING_LANGUAGE_VERSION', or `GL_EXTENSIONS'.
8682 `glGetString' returns a pointer to a static string describing some
8683 aspect of the current GL connection. NAME can be one of the following:
8688 Returns the company responsible for this GL implementation. This
8689 name does not change from release to release.
8694 Returns the name of the renderer. This name is typically specific
8695 to a particular configuration of a hardware platform. It does not
8696 change from release to release.
8701 Returns a version or release number.
8703 `GL_SHADING_LANGUAGE_VERSION'
8706 Returns a version or release number for the shading language.
8711 Returns a space-separated list of supported extensions to GL.
8713 Because the GL does not include queries for the performance
8714 characteristics of an implementation, some applications are written to
8715 recognize known platforms and modify their GL usage based on known
8716 performance characteristics of these platforms. Strings `GL_VENDOR' and
8717 `GL_RENDERER' together uniquely specify a platform. They do not change
8718 from release to release and should be used by platform-recognition
8721 Some applications want to make use of features that are not part of the
8722 standard GL. These features may be implemented as extensions to the
8723 standard GL. The `GL_EXTENSIONS' string is a space-separated list of
8724 supported GL extensions. (Extension names never contain a space
8727 The `GL_VERSION' and `GL_SHADING_LANGUAGE_VERSION' strings begin with a
8728 version number. The version number uses one of these forms:
8730 MAJOR_NUMBER.MINOR_NUMBERMAJOR_NUMBER.MINOR_NUMBER.RELEASE_NUMBER
8732 Vendor-specific information may follow the version number. Its format
8733 depends on the implementation, but a space always separates the version
8734 number and the vendor-specific information.
8736 All strings are null-terminated.
8738 `GL_INVALID_ENUM' is generated if NAME is not an accepted value.
8740 `GL_INVALID_OPERATION' is generated if `glGetString' is executed between
8741 the execution of `glBegin' and the corresponding execution of `glEnd'.")
8743 (define-gl-procedure
8752 "Return a texture image.
8755 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
8756 `GL_TEXTURE_2D', `GL_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
8757 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
8758 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
8759 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
8762 Specifies the level-of-detail number of the desired image. Level 0
8763 is the base image level. Level N is the N th mipmap reduction
8767 Specifies a pixel format for the returned data. The supported
8768 formats are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
8769 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
8770 `GL_LUMINANCE_ALPHA'.
8773 Specifies a pixel type for the returned data. The supported types
8774 are `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
8775 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
8776 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
8777 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
8778 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
8779 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
8780 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
8781 `GL_UNSIGNED_INT_2_10_10_10_REV'.
8784 Returns the texture image. Should be a pointer to an array of the
8785 type specified by TYPE.
8787 `glGetTexImage' returns a texture image into IMG. TARGET specifies
8788 whether the desired texture image is one specified by `glTexImage1D'
8789 (`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
8790 `GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LEVEL
8791 specifies the level-of-detail number of the desired image. FORMAT and
8792 TYPE specify the format and type of the desired image array. See the
8793 reference pages `glTexImage1D' and `glDrawPixels' for a description of
8794 the acceptable values for the FORMAT and TYPE parameters, respectively.
8796 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8797 target (see `glBindBuffer') while a texture image is requested, IMG is
8798 treated as a byte offset into the buffer object's data store.
8800 To understand the operation of `glGetTexImage', consider the selected
8801 internal four-component texture image to be an RGBA color buffer the
8802 size of the image. The semantics of `glGetTexImage' are then identical
8803 to those of `glReadPixels', with the exception that no pixel transfer
8804 operations are performed, when called with the same FORMAT and TYPE,
8805 with X and Y set to 0, WIDTH set to the width of the texture image
8806 (including border if one was specified), and HEIGHT set to 1 for 1D
8807 images, or to the height of the texture image (including border if one
8808 was specified) for 2D images. Because the internal texture image is an
8809 RGBA image, pixel formats `GL_COLOR_INDEX', `GL_STENCIL_INDEX', and
8810 `GL_DEPTH_COMPONENT' are not accepted, and pixel type `GL_BITMAP' is not
8813 If the selected texture image does not contain four components, the
8814 following mappings are applied. Single-component textures are treated as
8815 RGBA buffers with red set to the single-component value, green set to 0,
8816 blue set to 0, and alpha set to 1. Two-component textures are treated as
8817 RGBA buffers with red set to the value of component zero, alpha set to
8818 the value of component one, and green and blue set to 0. Finally,
8819 three-component textures are treated as RGBA buffers with red set to
8820 component zero, green set to component one, blue set to component two,
8823 To determine the required size of IMG, use `glGetTexLevelParameter' to
8824 determine the dimensions of the internal texture image, then scale the
8825 required number of pixels by the storage required for each pixel, based
8826 on FORMAT and TYPE. Be sure to take the pixel storage parameters into
8827 account, especially `GL_PACK_ALIGNMENT'.
8829 `GL_INVALID_ENUM' is generated if TARGET, FORMAT, or TYPE is not an
8832 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
8834 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
8835 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
8837 `GL_INVALID_OPERATION' is returned if TYPE is one of
8838 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8839 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8842 `GL_INVALID_OPERATION' is returned if TYPE is one of
8843 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8844 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8845 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8846 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV', and
8847 FORMAT is neither `GL_RGBA' or `GL_BGRA'.
8849 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8850 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8851 store is currently mapped.
8853 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8854 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8855 to the buffer object such that the memory writes required would exceed
8856 the data store size.
8858 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8859 bound to the `GL_PIXEL_PACK_BUFFER' target and IMG is not evenly
8860 divisible into the number of bytes needed to store in memory a datum
8863 `GL_INVALID_OPERATION' is generated if `glGetTexImage' is executed
8864 between the execution of `glBegin' and the corresponding execution of
8867 (define-gl-procedure
8868 ((glGetUniformLocation
8873 "Returns the location of a uniform variable.
8876 Specifies the program object to be queried.
8879 Points to a null terminated string containing the name of the
8880 uniform variable whose location is to be queried.
8882 `glGetUniformLocation ' returns an integer that represents the location
8883 of a specific uniform variable within a program object. NAME must be a
8884 null terminated string that contains no white space. NAME must be an
8885 active uniform variable name in PROGRAM that is not a structure, an
8886 array of structures, or a subcomponent of a vector or a matrix. This
8887 function returns -1 if NAME does not correspond to an active uniform
8888 variable in PROGRAM or if NAME starts with the reserved prefix \"gl_\".
8890 Uniform variables that are structures or arrays of structures may be
8891 queried by calling `glGetUniformLocation' for each field within the
8892 structure. The array element operator \"[]\" and the structure field
8893 operator \".\" may be used in NAME in order to select elements within an
8894 array or fields within a structure. The result of using these operators
8895 is not allowed to be another structure, an array of structures, or a
8896 subcomponent of a vector or a matrix. Except if the last part of NAME
8897 indicates a uniform variable array, the location of the first element of
8898 an array can be retrieved by using the name of the array, or by using
8899 the name appended by \"[0]\".
8901 The actual locations assigned to uniform variables are not known until
8902 the program object is linked successfully. After linking has occurred,
8903 the command `glGetUniformLocation' can be used to obtain the location of
8904 a uniform variable. This location value can then be passed to
8905 `glUniform' to set the value of the uniform variable or to
8906 `glGetUniform' in order to query the current value of the uniform
8907 variable. After a program object has been linked successfully, the index
8908 values for uniform variables remain fixed until the next link command
8909 occurs. Uniform variable locations and values can only be queried after
8910 a link if the link was successful.
8912 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
8915 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
8917 `GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
8920 `GL_INVALID_OPERATION' is generated if `glGetUniformLocation' is
8921 executed between the execution of `glBegin' and the corresponding
8922 execution of `glEnd'.")
8924 (define-gl-procedure
8925 ((glHint (target GLenum) (mode GLenum) -> void))
8926 "Specify implementation-specific hints.
8929 Specifies a symbolic constant indicating the behavior to be
8930 controlled. `GL_FOG_HINT', `GL_GENERATE_MIPMAP_HINT',
8931 `GL_LINE_SMOOTH_HINT', `GL_PERSPECTIVE_CORRECTION_HINT',
8932 `GL_POINT_SMOOTH_HINT', `GL_POLYGON_SMOOTH_HINT',
8933 `GL_TEXTURE_COMPRESSION_HINT', and
8934 `GL_FRAGMENT_SHADER_DERIVATIVE_HINT' are accepted.
8937 Specifies a symbolic constant indicating the desired behavior.
8938 `GL_FASTEST', `GL_NICEST', and `GL_DONT_CARE' are accepted.
8940 Certain aspects of GL behavior, when there is room for interpretation,
8941 can be controlled with hints. A hint is specified with two arguments.
8942 TARGET is a symbolic constant indicating the behavior to be controlled,
8943 and MODE is another symbolic constant indicating the desired behavior.
8944 The initial value for each TARGET is `GL_DONT_CARE'. MODE can be one of
8950 The most efficient option should be chosen.
8955 The most correct, or highest quality, option should be chosen.
8962 Though the implementation aspects that can be hinted are well defined,
8963 the interpretation of the hints depends on the implementation. The hint
8964 aspects that can be specified with TARGET, along with suggested
8965 semantics, are as follows:
8970 Indicates the accuracy of fog calculation. If per-pixel fog
8971 calculation is not efficiently supported by the GL implementation,
8972 hinting `GL_DONT_CARE' or `GL_FASTEST' can result in per-vertex
8973 calculation of fog effects.
8975 `GL_FRAGMENT_SHADER_DERIVATIVE_HINT'
8978 Indicates the accuracy of the derivative calculation for the GL
8979 shading language fragment processing built-in functions: `dFdx',
8980 `dFdy', and `fwidth'.
8982 `GL_GENERATE_MIPMAP_HINT'
8985 Indicates the quality of filtering when generating mipmap images.
8987 `GL_LINE_SMOOTH_HINT'
8990 Indicates the sampling quality of antialiased lines. If a larger
8991 filter function is applied, hinting `GL_NICEST' can result in more
8992 pixel fragments being generated during rasterization.
8994 `GL_PERSPECTIVE_CORRECTION_HINT'
8997 Indicates the quality of color, texture coordinate, and fog
8998 coordinate interpolation. If perspective-corrected parameter
8999 interpolation is not efficiently supported by the GL
9000 implementation, hinting `GL_DONT_CARE' or `GL_FASTEST' can result
9001 in simple linear interpolation of colors and/or texture
9004 `GL_POINT_SMOOTH_HINT'
9007 Indicates the sampling quality of antialiased points. If a larger
9008 filter function is applied, hinting `GL_NICEST' can result in more
9009 pixel fragments being generated during rasterization.
9011 `GL_POLYGON_SMOOTH_HINT'
9014 Indicates the sampling quality of antialiased polygons. Hinting
9015 `GL_NICEST' can result in more pixel fragments being generated
9016 during rasterization, if a larger filter function is applied.
9018 `GL_TEXTURE_COMPRESSION_HINT'
9021 Indicates the quality and performance of the compressing texture
9022 images. Hinting `GL_FASTEST' indicates that texture images should
9023 be compressed as quickly as possible, while `GL_NICEST' indicates
9024 that texture images should be compressed with as little image
9025 quality loss as possible. `GL_NICEST' should be selected if the
9026 texture is to be retrieved by `glGetCompressedTexImage' for reuse.
9028 `GL_INVALID_ENUM' is generated if either TARGET or MODE is not an
9031 `GL_INVALID_OPERATION' is generated if `glHint' is executed between the
9032 execution of `glBegin' and the corresponding execution of `glEnd'.")
9034 (define-gl-procedure
9038 (internalformat GLenum)
9042 "Define histogram table.
9045 The histogram whose parameters are to be set. Must be one of
9046 `GL_HISTOGRAM' or `GL_PROXY_HISTOGRAM'.
9049 The number of entries in the histogram table. Must be a power of 2.
9052 The format of entries in the histogram table. Must be one of
9053 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
9054 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
9055 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
9056 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
9057 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
9058 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
9059 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
9060 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
9061 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
9064 If `GL_TRUE', pixels will be consumed by the histogramming process
9065 and no drawing or texture loading will take place. If `GL_FALSE',
9066 pixels will proceed to the minmax process after histogramming.
9068 When `GL_HISTOGRAM' is enabled, RGBA color components are converted to
9069 histogram table indices by clamping to the range [0,1], multiplying by
9070 the width of the histogram table, and rounding to the nearest integer.
9071 The table entries selected by the RGBA indices are then incremented. (If
9072 the internal format of the histogram table includes luminance, then the
9073 index derived from the R color component determines the luminance table
9074 entry to be incremented.) If a histogram table entry is incremented
9075 beyond its maximum value, then its value becomes undefined. (This is not
9078 Histogramming is performed only for RGBA pixels (though these may be
9079 specified originally as color indices and converted to RGBA by index
9080 table lookup). Histogramming is enabled with `glEnable' and disabled
9083 When TARGET is `GL_HISTOGRAM', `glHistogram' redefines the current
9084 histogram table to have WIDTH entries of the format specified by
9085 INTERNALFORMAT. The entries are indexed 0 through WIDTH-1 , and all
9086 entries are initialized to zero. The values in the previous histogram
9087 table, if any, are lost. If SINK is `GL_TRUE', then pixels are discarded
9088 after histogramming; no further processing of the pixels takes place,
9089 and no drawing, texture loading, or pixel readback will result.
9091 When TARGET is `GL_PROXY_HISTOGRAM', `glHistogram' computes all state
9092 information as if the histogram table were to be redefined, but does not
9093 actually define the new table. If the requested histogram table is too
9094 large to be supported, then the state information will be set to zero.
9095 This provides a way to determine if a histogram table with the given
9096 parameters can be supported.
9100 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
9103 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or is not a
9106 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
9109 `GL_TABLE_TOO_LARGE' is generated if TARGET is `GL_HISTOGRAM' and the
9110 histogram table specified is too large for the implementation.
9112 `GL_INVALID_OPERATION' is generated if `glHistogram' is executed between
9113 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9115 (define-gl-procedure
9116 ((glIndexMask (mask GLuint) -> void))
9117 "Control the writing of individual bits in the color index buffers.
9120 Specifies a bit mask to enable and disable the writing of
9121 individual bits in the color index buffers. Initially, the mask is
9124 `glIndexMask' controls the writing of individual bits in the color index
9125 buffers. The least significant N bits of MASK, where N is the number of
9126 bits in a color index buffer, specify a mask. Where a 1 (one) appears in
9127 the mask, it's possible to write to the corresponding bit in the color
9128 index buffer (or buffers). Where a 0 (zero) appears, the corresponding
9129 bit is write-protected.
9131 This mask is used only in color index mode, and it affects only the
9132 buffers currently selected for writing (see `glDrawBuffer'). Initially,
9133 all bits are enabled for writing.
9135 `GL_INVALID_OPERATION' is generated if `glIndexMask' is executed between
9136 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9138 (define-gl-procedure
9145 "Define an array of color indexes.
9148 Specifies the data type of each color index in the array. Symbolic
9149 constants `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
9150 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
9153 Specifies the byte offset between consecutive color indexes. If
9154 STRIDE is 0, the color indexes are understood to be tightly packed
9155 in the array. The initial value is 0.
9158 Specifies a pointer to the first index in the array. The initial
9161 `glIndexPointer' specifies the location and data format of an array of
9162 color indexes to use when rendering. TYPE specifies the data type of
9163 each color index and STRIDE specifies the byte stride from one color
9164 index to the next, allowing vertices and attributes to be packed into a
9165 single array or stored in separate arrays.
9167 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
9168 target (see `glBindBuffer') while a color index array is specified,
9169 POINTER is treated as a byte offset into the buffer object's data store.
9170 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
9171 color index vertex array client-side state
9172 (`GL_INDEX_ARRAY_BUFFER_BINDING').
9174 When a color index array is specified, TYPE, STRIDE, and POINTER are
9175 saved as client-side state, in addition to the current vertex array
9176 buffer object binding.
9178 To enable and disable the color index array, call `glEnableClientState'
9179 and `glDisableClientState' with the argument `GL_INDEX_ARRAY'. If
9180 enabled, the color index array is used when `glDrawArrays',
9181 `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
9182 `glDrawRangeElements', or `glArrayElement' is called.
9184 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
9186 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
9188 (define-gl-procedure
9189 ((glIndexi (c GLint) -> void)
9190 (glIndexd (c GLdouble) -> void)
9191 (glIndexub (c GLubyte) -> void))
9192 "Set the current color index.
9195 Specifies the new value for the current color index.
9199 `glIndex' updates the current (single-valued) color index. It takes one
9200 argument, the new value for the current color index.
9202 The current index is stored as a floating-point value. Integer values
9203 are converted directly to floating-point values, with no special
9204 mapping. The initial value is 1.
9206 Index values outside the representable range of the color index buffer
9207 are not clamped. However, before an index is dithered (if enabled) and
9208 written to the frame buffer, it is converted to fixed-point format. Any
9209 bits in the integer portion of the resulting fixed-point value that do
9210 not correspond to bits in the frame buffer are masked out.")
9212 (define-gl-procedure
9213 ((glInitNames -> void))
9214 "Initialize the name stack.
9216 The name stack is used during selection mode to allow sets of rendering
9217 commands to be uniquely identified. It consists of an ordered set of
9218 unsigned integers. `glInitNames' causes the name stack to be initialized
9219 to its default empty state.
9221 The name stack is always empty while the render mode is not `GL_SELECT'.
9222 Calls to `glInitNames' while the render mode is not `GL_SELECT' are
9225 `GL_INVALID_OPERATION' is generated if `glInitNames' is executed between
9226 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9228 (define-gl-procedure
9229 ((glInterleavedArrays
9235 "Simultaneously specify and enable several interleaved arrays.
9238 Specifies the type of array to enable. Symbolic constants `GL_V2F',
9239 `GL_V3F', `GL_C4UB_V2F', `GL_C4UB_V3F', `GL_C3F_V3F', `GL_N3F_V3F',
9240 `GL_C4F_N3F_V3F', `GL_T2F_V3F', `GL_T4F_V4F', `GL_T2F_C4UB_V3F',
9241 `GL_T2F_C3F_V3F', `GL_T2F_N3F_V3F', `GL_T2F_C4F_N3F_V3F', and
9242 `GL_T4F_C4F_N3F_V4F' are accepted.
9245 Specifies the offset in bytes between each aggregate array element.
9247 `glInterleavedArrays' lets you specify and enable individual color,
9248 normal, texture and vertex arrays whose elements are part of a larger
9249 aggregate array element. For some implementations, this is more
9250 efficient than specifying the arrays separately.
9252 If STRIDE is 0, the aggregate elements are stored consecutively.
9253 Otherwise, STRIDE bytes occur between the beginning of one aggregate
9254 array element and the beginning of the next aggregate array element.
9256 FORMAT serves as a ``key'' describing the extraction of individual
9257 arrays from the aggregate array. If FORMAT contains a T, then texture
9258 coordinates are extracted from the interleaved array. If C is present,
9259 color values are extracted. If N is present, normal coordinates are
9260 extracted. Vertex coordinates are always extracted.
9262 The digits 2, 3, and 4 denote how many values are extracted. F indicates
9263 that values are extracted as floating-point values. Colors may also be
9264 extracted as 4 unsigned bytes if 4UB follows the C. If a color is
9265 extracted as 4 unsigned bytes, the vertex array element which follows is
9266 located at the first possible floating-point aligned address.
9268 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted value.
9270 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
9272 (define-gl-procedure
9273 ((glIsBuffer (buffer GLuint) -> GLboolean))
9274 "Determine if a name corresponds to a buffer object.
9277 Specifies a value that may be the name of a buffer object.
9279 `glIsBuffer' returns `GL_TRUE' if BUFFER is currently the name of a
9280 buffer object. If BUFFER is zero, or is a non-zero value that is not
9281 currently the name of a buffer object, or if an error occurs,
9282 `glIsBuffer' returns `GL_FALSE'.
9284 A name returned by `glGenBuffers', but not yet associated with a buffer
9285 object by calling `glBindBuffer', is not the name of a buffer object.
9287 `GL_INVALID_OPERATION' is generated if `glIsBuffer' is executed between
9288 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9290 (define-gl-procedure
9291 ((glIsEnabled (cap GLenum) -> GLboolean))
9292 "Test whether a capability is enabled.
9295 Specifies a symbolic constant indicating a GL capability.
9297 `glIsEnabled' returns `GL_TRUE' if CAP is an enabled capability and
9298 returns `GL_FALSE' otherwise. Initially all capabilities except
9299 `GL_DITHER' are disabled; `GL_DITHER' is initially enabled.
9301 The following capabilities are accepted for CAP:
9315 `glBlendFunc', `glLogicOp'
9336 `glConvolutionFilter1D'
9339 `glConvolutionFilter2D'
9345 `glDepthFunc', `glDepthRange'
9350 `GL_EDGE_FLAG_ARRAY'
9356 `GL_FOG_COORD_ARRAY'
9369 `glLightModel', `glLight'
9372 `glMaterial', `glLightModel', `glLight'
9389 `GL_MAP1_TEXTURE_COORD_1'
9392 `GL_MAP1_TEXTURE_COORD_2'
9395 `GL_MAP1_TEXTURE_COORD_3'
9398 `GL_MAP1_TEXTURE_COORD_4'
9410 `GL_MAP2_TEXTURE_COORD_1'
9413 `GL_MAP2_TEXTURE_COORD_2'
9416 `GL_MAP2_TEXTURE_COORD_3'
9419 `GL_MAP2_TEXTURE_COORD_4'
9449 `GL_POLYGON_OFFSET_FILL'
9452 `GL_POLYGON_OFFSET_LINE'
9455 `GL_POLYGON_OFFSET_POINT'
9458 `GL_POLYGON_STIPPLE'
9461 `GL_POST_COLOR_MATRIX_COLOR_TABLE'
9464 `GL_POST_CONVOLUTION_COLOR_TABLE'
9470 `GL_SAMPLE_ALPHA_TO_COVERAGE'
9473 `GL_SAMPLE_ALPHA_TO_ONE'
9476 `GL_SAMPLE_COVERAGE'
9482 `GL_SECONDARY_COLOR_ARRAY'
9483 `glSecondaryColorPointer'
9486 `glSeparableFilter2D'
9489 `glStencilFunc', `glStencilOp'
9500 `GL_TEXTURE_COORD_ARRAY'
9503 `GL_TEXTURE_CUBE_MAP'
9521 `GL_VERTEX_PROGRAM_POINT_SIZE'
9524 `GL_VERTEX_PROGRAM_TWO_SIDE'
9529 `GL_INVALID_ENUM' is generated if CAP is not an accepted value.
9531 `GL_INVALID_OPERATION' is generated if `glIsEnabled' is executed between
9532 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9534 (define-gl-procedure
9535 ((glIsList (list GLuint) -> GLboolean))
9536 "Determine if a name corresponds to a display list.
9539 Specifies a potential display list name.
9541 `glIsList' returns `GL_TRUE' if LIST is the name of a display list and
9542 returns `GL_FALSE' if it is not, or if an error occurs.
9544 A name returned by `glGenLists', but not yet associated with a display
9545 list by calling `glNewList', is not the name of a display list.
9547 `GL_INVALID_OPERATION' is generated if `glIsList' is executed between
9548 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9550 (define-gl-procedure
9551 ((glIsProgram (program GLuint) -> GLboolean))
9552 "Determines if a name corresponds to a program object.
9555 Specifies a potential program object.
9557 `glIsProgram' returns `GL_TRUE' if PROGRAM is the name of a program
9558 object previously created with `glCreateProgram' and not yet deleted
9559 with `glDeleteProgram'. If PROGRAM is zero or a non-zero value that is
9560 not the name of a program object, or if an error occurs, `glIsProgram'
9563 `GL_INVALID_OPERATION' is generated if `glIsProgram' is executed between
9564 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9566 (define-gl-procedure
9567 ((glIsQuery (id GLuint) -> GLboolean))
9568 "Determine if a name corresponds to a query object.
9571 Specifies a value that may be the name of a query object.
9573 `glIsQuery' returns `GL_TRUE' if ID is currently the name of a query
9574 object. If ID is zero, or is a non-zero value that is not currently the
9575 name of a query object, or if an error occurs, `glIsQuery' returns
9578 A name returned by `glGenQueries', but not yet associated with a query
9579 object by calling `glBeginQuery', is not the name of a query object.
9581 `GL_INVALID_OPERATION' is generated if `glIsQuery' is executed between
9582 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9584 (define-gl-procedure
9585 ((glIsShader (shader GLuint) -> GLboolean))
9586 "Determines if a name corresponds to a shader object.
9589 Specifies a potential shader object.
9591 `glIsShader' returns `GL_TRUE' if SHADER is the name of a shader object
9592 previously created with `glCreateShader' and not yet deleted with
9593 `glDeleteShader'. If SHADER is zero or a non-zero value that is not the
9594 name of a shader object, or if an error occurs, `glIsShader ' returns
9597 `GL_INVALID_OPERATION' is generated if `glIsShader' is executed between
9598 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9600 (define-gl-procedure
9601 ((glIsTexture (texture GLuint) -> GLboolean))
9602 "Determine if a name corresponds to a texture.
9605 Specifies a value that may be the name of a texture.
9607 `glIsTexture' returns `GL_TRUE' if TEXTURE is currently the name of a
9608 texture. If TEXTURE is zero, or is a non-zero value that is not
9609 currently the name of a texture, or if an error occurs, `glIsTexture'
9612 A name returned by `glGenTextures', but not yet associated with a
9613 texture by calling `glBindTexture', is not the name of a texture.
9615 `GL_INVALID_OPERATION' is generated if `glIsTexture' is executed between
9616 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9618 (define-gl-procedure
9629 "Set the lighting model parameters.
9632 Specifies a single-valued lighting model parameter.
9633 `GL_LIGHT_MODEL_LOCAL_VIEWER', `GL_LIGHT_MODEL_COLOR_CONTROL', and
9634 `GL_LIGHT_MODEL_TWO_SIDE' are accepted.
9637 Specifies the value that PARAM will be set to.
9639 `glLightModel' sets the lighting model parameter. PNAME names a
9640 parameter and PARAMS gives the new value. There are three lighting model
9643 `GL_LIGHT_MODEL_AMBIENT'
9646 PARAMS contains four integer or floating-point values that specify
9647 the ambient RGBA intensity of the entire scene. Integer values are
9648 mapped linearly such that the most positive representable value
9649 maps to 1.0, and the most negative representable value maps to -1.0
9650 . Floating-point values are mapped directly. Neither integer nor
9651 floating-point values are clamped. The initial ambient scene
9652 intensity is (0.2, 0.2, 0.2, 1.0).
9654 `GL_LIGHT_MODEL_COLOR_CONTROL'
9657 PARAMS must be either `GL_SEPARATE_SPECULAR_COLOR' or
9658 `GL_SINGLE_COLOR'. `GL_SINGLE_COLOR' specifies that a single color
9659 is generated from the lighting computation for a vertex.
9660 `GL_SEPARATE_SPECULAR_COLOR' specifies that the specular color
9661 computation of lighting be stored separately from the remainder of
9662 the lighting computation. The specular color is summed into the
9663 generated fragment's color after the application of texture mapping
9664 (if enabled). The initial value is `GL_SINGLE_COLOR'.
9666 `GL_LIGHT_MODEL_LOCAL_VIEWER'
9669 PARAMS is a single integer or floating-point value that specifies
9670 how specular reflection angles are computed. If PARAMS is 0 (or
9671 0.0), specular reflection angles take the view direction to be
9672 parallel to and in the direction of the -Z axis, regardless of the
9673 location of the vertex in eye coordinates. Otherwise, specular
9674 reflections are computed from the origin of the eye coordinate
9675 system. The initial value is 0.
9677 `GL_LIGHT_MODEL_TWO_SIDE'
9680 PARAMS is a single integer or floating-point value that specifies
9681 whether one- or two-sided lighting calculations are done for
9682 polygons. It has no effect on the lighting calculations for points,
9683 lines, or bitmaps. If PARAMS is 0 (or 0.0), one-sided lighting is
9684 specified, and only the FRONT material parameters are used in the
9685 lighting equation. Otherwise, two-sided lighting is specified. In
9686 this case, vertices of back-facing polygons are lighted using the
9687 BACK material parameters and have their normals reversed before the
9688 lighting equation is evaluated. Vertices of front-facing polygons
9689 are always lighted using the FRONT material parameters, with no
9690 change to their normals. The initial value is 0.
9692 In RGBA mode, the lighted color of a vertex is the sum of the material
9693 emission intensity, the product of the material ambient reflectance and
9694 the lighting model full-scene ambient intensity, and the contribution of
9695 each enabled light source. Each light source contributes the sum of
9696 three terms: ambient, diffuse, and specular. The ambient light source
9697 contribution is the product of the material ambient reflectance and the
9698 light's ambient intensity. The diffuse light source contribution is the
9699 product of the material diffuse reflectance, the light's diffuse
9700 intensity, and the dot product of the vertex's normal with the
9701 normalized vector from the vertex to the light source. The specular
9702 light source contribution is the product of the material specular
9703 reflectance, the light's specular intensity, and the dot product of the
9704 normalized vertex-to-eye and vertex-to-light vectors, raised to the
9705 power of the shininess of the material. All three light source
9706 contributions are attenuated equally based on the distance from the
9707 vertex to the light source and on light source direction, spread
9708 exponent, and spread cutoff angle. All dot products are replaced with 0
9709 if they evaluate to a negative value.
9711 The alpha component of the resulting lighted color is set to the alpha
9712 value of the material diffuse reflectance.
9714 In color index mode, the value of the lighted index of a vertex ranges
9715 from the ambient to the specular values passed to `glMaterial' using
9716 `GL_COLOR_INDEXES'. Diffuse and specular coefficients, computed with a
9717 (.30, .59, .11) weighting of the lights' colors, the shininess of the
9718 material, and the same reflection and attenuation equations as in the
9719 RGBA case, determine how much above ambient the resulting index is.
9721 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
9723 `GL_INVALID_ENUM' is generated if PNAME is
9724 `GL_LIGHT_MODEL_COLOR_CONTROL' and PARAMS is not one of
9725 `GL_SINGLE_COLOR' or `GL_SEPARATE_SPECULAR_COLOR'.
9727 `GL_INVALID_OPERATION' is generated if `glLightModel' is executed
9728 between the execution of `glBegin' and the corresponding execution of
9731 (define-gl-procedure
9744 "Set light source parameters.
9747 Specifies a light. The number of lights depends on the
9748 implementation, but at least eight lights are supported. They are
9749 identified by symbolic names of the form `GL_LIGHT' I , where i
9750 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
9753 Specifies a single-valued light source parameter for LIGHT.
9754 `GL_SPOT_EXPONENT', `GL_SPOT_CUTOFF', `GL_CONSTANT_ATTENUATION',
9755 `GL_LINEAR_ATTENUATION', and `GL_QUADRATIC_ATTENUATION' are
9759 Specifies the value that parameter PNAME of light source LIGHT will
9762 `glLight' sets the values of individual light source parameters. LIGHT
9763 names the light and is a symbolic name of the form `GL_LIGHT'I , where i
9764 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1. PNAME specifies one
9765 of ten light source parameters, again by symbolic name. PARAMS is either
9766 a single value or a pointer to an array that contains the new values.
9768 To enable and disable lighting calculation, call `glEnable' and
9769 `glDisable' with argument `GL_LIGHTING'. Lighting is initially disabled.
9770 When it is enabled, light sources that are enabled contribute to the
9771 lighting calculation. Light source I is enabled and disabled using
9772 `glEnable' and `glDisable' with argument `GL_LIGHT'I .
9774 The ten light parameters are as follows:
9777 PARAMS contains four integer or floating-point values that specify
9778 the ambient RGBA intensity of the light. Integer values are mapped
9779 linearly such that the most positive representable value maps to
9780 1.0, and the most negative representable value maps to -1.0 .
9781 Floating-point values are mapped directly. Neither integer nor
9782 floating-point values are clamped. The initial ambient light
9783 intensity is (0, 0, 0, 1).
9786 PARAMS contains four integer or floating-point values that specify
9787 the diffuse RGBA intensity of the light. Integer values are mapped
9788 linearly such that the most positive representable value maps to
9789 1.0, and the most negative representable value maps to -1.0 .
9790 Floating-point values are mapped directly. Neither integer nor
9791 floating-point values are clamped. The initial value for
9792 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
9796 PARAMS contains four integer or floating-point values that specify
9797 the specular RGBA intensity of the light. Integer values are mapped
9798 linearly such that the most positive representable value maps to
9799 1.0, and the most negative representable value maps to -1.0 .
9800 Floating-point values are mapped directly. Neither integer nor
9801 floating-point values are clamped. The initial value for
9802 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
9806 PARAMS contains four integer or floating-point values that specify
9807 the position of the light in homogeneous object coordinates. Both
9808 integer and floating-point values are mapped directly. Neither
9809 integer nor floating-point values are clamped.
9811 The position is transformed by the modelview matrix when `glLight'
9812 is called (just as if it were a point), and it is stored in eye
9813 coordinates. If the W component of the position is 0, the light is
9814 treated as a directional source. Diffuse and specular lighting
9815 calculations take the light's direction, but not its actual
9816 position, into account, and attenuation is disabled. Otherwise,
9817 diffuse and specular lighting calculations are based on the actual
9818 location of the light in eye coordinates, and attenuation is
9819 enabled. The initial position is (0, 0, 1, 0); thus, the initial
9820 light source is directional, parallel to, and in the direction of
9824 PARAMS contains three integer or floating-point values that specify
9825 the direction of the light in homogeneous object coordinates. Both
9826 integer and floating-point values are mapped directly. Neither
9827 integer nor floating-point values are clamped.
9829 The spot direction is transformed by the upper 3x3 of the modelview
9830 matrix when `glLight' is called, and it is stored in eye
9831 coordinates. It is significant only when `GL_SPOT_CUTOFF' is not
9832 180, which it is initially. The initial direction is (0,0-1) .
9835 PARAMS is a single integer or floating-point value that specifies
9836 the intensity distribution of the light. Integer and floating-point
9837 values are mapped directly. Only values in the range [0,128] are
9840 Effective light intensity is attenuated by the cosine of the angle
9841 between the direction of the light and the direction from the light
9842 to the vertex being lighted, raised to the power of the spot
9843 exponent. Thus, higher spot exponents result in a more focused
9844 light source, regardless of the spot cutoff angle (see
9845 `GL_SPOT_CUTOFF', next paragraph). The initial spot exponent is 0,
9846 resulting in uniform light distribution.
9849 PARAMS is a single integer or floating-point value that specifies
9850 the maximum spread angle of a light source. Integer and
9851 floating-point values are mapped directly. Only values in the range
9852 [0,90] and the special value 180 are accepted. If the angle between
9853 the direction of the light and the direction from the light to the
9854 vertex being lighted is greater than the spot cutoff angle, the
9855 light is completely masked. Otherwise, its intensity is controlled
9856 by the spot exponent and the attenuation factors. The initial spot
9857 cutoff is 180, resulting in uniform light distribution.
9859 `GL_CONSTANT_ATTENUATION'
9860 `GL_LINEAR_ATTENUATION'
9861 `GL_QUADRATIC_ATTENUATION'
9862 PARAMS is a single integer or floating-point value that specifies
9863 one of the three light attenuation factors. Integer and
9864 floating-point values are mapped directly. Only nonnegative values
9865 are accepted. If the light is positional, rather than directional,
9866 its intensity is attenuated by the reciprocal of the sum of the
9867 constant factor, the linear factor times the distance between the
9868 light and the vertex being lighted, and the quadratic factor times
9869 the square of the same distance. The initial attenuation factors
9870 are (1, 0, 0), resulting in no attenuation.
9872 `GL_INVALID_ENUM' is generated if either LIGHT or PNAME is not an
9875 `GL_INVALID_VALUE' is generated if a spot exponent value is specified
9876 outside the range [0,128] , or if spot cutoff is specified outside the
9877 range [0,90] (except for the special value 180), or if a negative
9878 attenuation factor is specified.
9880 `GL_INVALID_OPERATION' is generated if `glLight' is executed between the
9881 execution of `glBegin' and the corresponding execution of `glEnd'.")
9883 (define-gl-procedure
9889 "Specify the line stipple pattern.
9892 Specifies a multiplier for each bit in the line stipple pattern. If
9893 FACTOR is 3, for example, each bit in the pattern is used three
9894 times before the next bit in the pattern is used. FACTOR is clamped
9895 to the range [1, 256] and defaults to 1.
9898 Specifies a 16-bit integer whose bit pattern determines which
9899 fragments of a line will be drawn when the line is rasterized. Bit
9900 zero is used first; the default pattern is all 1's.
9902 Line stippling masks out certain fragments produced by rasterization;
9903 those fragments will not be drawn. The masking is achieved by using
9904 three parameters: the 16-bit line stipple pattern PATTERN, the repeat
9905 count FACTOR, and an integer stipple counter S .
9907 Counter S is reset to 0 whenever `glBegin' is called and before each
9908 line segment of a `glBegin'(`GL_LINES')/`glEnd' sequence is generated.
9909 It is incremented after each fragment of a unit width aliased line
9910 segment is generated or after each I fragments of an I width line
9911 segment are generated. The I fragments associated with count S are
9914 PATTERN bit (S/FACTOR,)%16
9916 is 0, otherwise these fragments are sent to the frame buffer. Bit zero
9917 of PATTERN is the least significant bit.
9919 Antialiased lines are treated as a sequence of 1×WIDTH rectangles for
9920 purposes of stippling. Whether rectangle S is rasterized or not depends
9921 on the fragment rule described for aliased lines, counting rectangles
9922 rather than groups of fragments.
9924 To enable and disable line stippling, call `glEnable' and `glDisable'
9925 with argument `GL_LINE_STIPPLE'. When enabled, the line stipple pattern
9926 is applied as described above. When disabled, it is as if the pattern
9927 were all 1's. Initially, line stippling is disabled.
9929 `GL_INVALID_OPERATION' is generated if `glLineStipple' is executed
9930 between the execution of `glBegin' and the corresponding execution of
9933 (define-gl-procedure
9934 ((glLineWidth (width GLfloat) -> void))
9935 "Specify the width of rasterized lines.
9938 Specifies the width of rasterized lines. The initial value is 1.
9940 `glLineWidth' specifies the rasterized width of both aliased and
9941 antialiased lines. Using a line width other than 1 has different
9942 effects, depending on whether line antialiasing is enabled. To enable
9943 and disable line antialiasing, call `glEnable' and `glDisable' with
9944 argument `GL_LINE_SMOOTH'. Line antialiasing is initially disabled.
9946 If line antialiasing is disabled, the actual width is determined by
9947 rounding the supplied width to the nearest integer. (If the rounding
9948 results in the value 0, it is as if the line width were 1.) If
9949 ∣ΔX,∣>=∣ΔY,∣ , I pixels are filled in each column that is rasterized,
9950 where I is the rounded value of WIDTH. Otherwise, I pixels are filled in
9951 each row that is rasterized.
9953 If antialiasing is enabled, line rasterization produces a fragment for
9954 each pixel square that intersects the region lying within the rectangle
9955 having width equal to the current line width, length equal to the actual
9956 length of the line, and centered on the mathematical line segment. The
9957 coverage value for each fragment is the window coordinate area of the
9958 intersection of the rectangular region with the corresponding pixel
9959 square. This value is saved and used in the final rasterization step.
9961 Not all widths can be supported when line antialiasing is enabled. If an
9962 unsupported width is requested, the nearest supported width is used.
9963 Only width 1 is guaranteed to be supported; others depend on the
9964 implementation. Likewise, there is a range for aliased line widths as
9965 well. To query the range of supported widths and the size difference
9966 between supported widths within the range, call `glGet' with arguments
9967 `GL_ALIASED_LINE_WIDTH_RANGE', `GL_SMOOTH_LINE_WIDTH_RANGE', and
9968 `GL_SMOOTH_LINE_WIDTH_GRANULARITY'.
9970 `GL_INVALID_VALUE' is generated if WIDTH is less than or equal to 0.
9972 `GL_INVALID_OPERATION' is generated if `glLineWidth' is executed between
9973 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9975 (define-gl-procedure
9976 ((glLinkProgram (program GLuint) -> void))
9977 "Links a program object.
9980 Specifies the handle of the program object to be linked.
9982 `glLinkProgram' links the program object specified by PROGRAM. If any
9983 shader objects of type `GL_VERTEX_SHADER' are attached to PROGRAM, they
9984 will be used to create an executable that will run on the programmable
9985 vertex processor. If any shader objects of type `GL_FRAGMENT_SHADER' are
9986 attached to PROGRAM, they will be used to create an executable that will
9987 run on the programmable fragment processor.
9989 The status of the link operation will be stored as part of the program
9990 object's state. This value will be set to `GL_TRUE' if the program
9991 object was linked without errors and is ready for use, and `GL_FALSE'
9992 otherwise. It can be queried by calling `glGetProgram' with arguments
9993 PROGRAM and `GL_LINK_STATUS'.
9995 As a result of a successful link operation, all active user-defined
9996 uniform variables belonging to PROGRAM will be initialized to 0, and
9997 each of the program object's active uniform variables will be assigned a
9998 location that can be queried by calling `glGetUniformLocation'. Also,
9999 any active user-defined attribute variables that have not been bound to
10000 a generic vertex attribute index will be bound to one at this time.
10002 Linking of a program object can fail for a number of reasons as
10003 specified in the OPENGL SHADING LANGUAGE SPECIFICATION. The following
10004 lists some of the conditions that will cause a link error.
10006 * The storage limit for uniform variables has been exceeded.
10008 * The number of active uniform variables supported by the
10009 implementation has been exceeded.
10011 * The `main' function is missing for the vertex shader or the
10014 * A varying variable actually used in the fragment shader is not
10015 declared in the same way (or is not declared at all) in the vertex
10018 * A reference to a function or variable name is unresolved.
10020 * A shared global is declared with two different types or two
10021 different initial values.
10023 * One or more of the attached shader objects has not been
10024 successfully compiled.
10026 * Binding a generic attribute matrix caused some rows of the matrix
10027 to fall outside the allowed maximum of `GL_MAX_VERTEX_ATTRIBS'.
10029 * Not enough contiguous vertex attribute slots could be found to bind
10030 attribute matrices.
10032 When a program object has been successfully linked, the program object
10033 can be made part of current state by calling `glUseProgram'. Whether or
10034 not the link operation was successful, the program object's information
10035 log will be overwritten. The information log can be retrieved by calling
10036 `glGetProgramInfoLog'.
10038 `glLinkProgram' will also install the generated executables as part of
10039 the current rendering state if the link operation was successful and the
10040 specified program object is already currently in use as a result of a
10041 previous call to `glUseProgram'. If the program object currently in use
10042 is relinked unsuccessfully, its link status will be set to `GL_FALSE' ,
10043 but the executables and associated state will remain part of the current
10044 state until a subsequent call to `glUseProgram' removes it from use.
10045 After it is removed from use, it cannot be made part of current state
10046 until it has been successfully relinked.
10048 If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but does
10049 not contain shader objects of type `GL_FRAGMENT_SHADER', the vertex
10050 shader will be linked against the implicit interface for fixed
10051 functionality fragment processing. Similarly, if PROGRAM contains shader
10052 objects of type `GL_FRAGMENT_SHADER' but it does not contain shader
10053 objects of type `GL_VERTEX_SHADER', the fragment shader will be linked
10054 against the implicit interface for fixed functionality vertex
10057 The program object's information log is updated and the program is
10058 generated at the time of the link operation. After the link operation,
10059 applications are free to modify attached shader objects, compile
10060 attached shader objects, detach shader objects, delete shader objects,
10061 and attach additional shader objects. None of these operations affects
10062 the information log or the program that is part of the program object.
10064 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
10067 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
10069 `GL_INVALID_OPERATION' is generated if `glLinkProgram' is executed
10070 between the execution of `glBegin' and the corresponding execution of
10073 (define-gl-procedure
10074 ((glListBase (base GLuint) -> void))
10075 "Set the display-list base for .
10078 Specifies an integer offset that will be added to `glCallLists'
10079 offsets to generate display-list names. The initial value is 0.
10081 `glCallLists' specifies an array of offsets. Display-list names are
10082 generated by adding BASE to each offset. Names that reference valid
10083 display lists are executed; the others are ignored.
10085 `GL_INVALID_OPERATION' is generated if `glListBase' is executed between
10086 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10088 (define-gl-procedure
10089 ((glLoadIdentity -> void))
10090 "Replace the current matrix with the identity matrix.
10092 `glLoadIdentity' replaces the current matrix with the identity matrix.
10093 It is semantically equivalent to calling `glLoadMatrix' with the
10098 ((1 0 0 0), (0 1 0 0), (0 0 1 0), (0 0 0 1),,)
10102 but in some cases it is more efficient.
10104 `GL_INVALID_OPERATION' is generated if `glLoadIdentity' is executed
10105 between the execution of `glBegin' and the corresponding execution of
10108 (define-gl-procedure
10109 ((glLoadMatrixd (m *) -> void))
10110 "Replace the current matrix with the specified matrix.
10113 Specifies a pointer to 16 consecutive values, which are used as the
10114 elements of a 4×4 column-major matrix.
10116 `glLoadMatrix' replaces the current matrix with the one whose elements
10117 are specified by M. The current matrix is the projection matrix,
10118 modelview matrix, or texture matrix, depending on the current matrix
10119 mode (see `glMatrixMode').
10121 The current matrix, M, defines a transformation of coordinates. For
10122 instance, assume M refers to the modelview matrix. If
10123 V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
10124 vertex, and M points to an array of 16 single- or double-precision
10125 floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
10126 transformation M\u2061(V,) does the following:
10128 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,]),
10129 (M\u2061[2,] M\u2061[6,] M\u2061[10,] M\u2061[14,]), (M\u2061[3,] M\u2061[7,] M\u2061[11,]
10130 M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
10134 Projection and texture transformations are similarly defined.
10136 `GL_INVALID_OPERATION' is generated if `glLoadMatrix' is executed
10137 between the execution of `glBegin' and the corresponding execution of
10140 (define-gl-procedure
10141 ((glLoadName (name GLuint) -> void))
10142 "Load a name onto the name stack.
10145 Specifies a name that will replace the top value on the name stack.
10147 The name stack is used during selection mode to allow sets of rendering
10148 commands to be uniquely identified. It consists of an ordered set of
10149 unsigned integers and is initially empty.
10151 `glLoadName' causes NAME to replace the value on the top of the name
10154 The name stack is always empty while the render mode is not `GL_SELECT'.
10155 Calls to `glLoadName' while the render mode is not `GL_SELECT' are
10158 `GL_INVALID_OPERATION' is generated if `glLoadName' is called while the
10159 name stack is empty.
10161 `GL_INVALID_OPERATION' is generated if `glLoadName' is executed between
10162 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10164 (define-gl-procedure
10165 ((glLoadTransposeMatrixd (m *) -> void))
10166 "Replace the current matrix with the specified row-major ordered matrix.
10169 Specifies a pointer to 16 consecutive values, which are used as the
10170 elements of a 4×4 row-major matrix.
10172 `glLoadTransposeMatrix' replaces the current matrix with the one whose
10173 elements are specified by M. The current matrix is the projection
10174 matrix, modelview matrix, or texture matrix, depending on the current
10175 matrix mode (see `glMatrixMode').
10177 The current matrix, M, defines a transformation of coordinates. For
10178 instance, assume M refers to the modelview matrix. If
10179 V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
10180 vertex, and M points to an array of 16 single- or double-precision
10181 floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
10182 transformation M\u2061(V,) does the following:
10184 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,]),
10185 (M\u2061[8,] M\u2061[9,] M\u2061[10,] M\u2061[11,]), (M\u2061[12,] M\u2061[13,] M\u2061[14,]
10186 M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
10190 Projection and texture transformations are similarly defined.
10192 Calling `glLoadTransposeMatrix' with matrix M is identical in operation
10193 to `glLoadMatrix' with M^T , where T represents the transpose.
10195 `GL_INVALID_OPERATION' is generated if `glLoadTransposeMatrix' is
10196 executed between the execution of `glBegin' and the corresponding
10197 execution of `glEnd'.")
10199 (define-gl-procedure
10200 ((glLogicOp (opcode GLenum) -> void))
10201 "Specify a logical pixel operation for color index rendering.
10204 Specifies a symbolic constant that selects a logical operation. The
10205 following symbols are accepted: `GL_CLEAR', `GL_SET', `GL_COPY',
10206 `GL_COPY_INVERTED', `GL_NOOP', `GL_INVERT', `GL_AND', `GL_NAND',
10207 `GL_OR', `GL_NOR', `GL_XOR', `GL_EQUIV', `GL_AND_REVERSE',
10208 `GL_AND_INVERTED', `GL_OR_REVERSE', and `GL_OR_INVERTED'. The
10209 initial value is `GL_COPY'.
10211 `glLogicOp' specifies a logical operation that, when enabled, is applied
10212 between the incoming color index or RGBA color and the color index or
10213 RGBA color at the corresponding location in the frame buffer. To enable
10214 or disable the logical operation, call `glEnable' and `glDisable' using
10215 the symbolic constant `GL_COLOR_LOGIC_OP' for RGBA mode or
10216 `GL_INDEX_LOGIC_OP' for color index mode. The initial value is disabled
10217 for both operations.
10222 *Resulting Operation*
10272 OPCODE is a symbolic constant chosen from the list above. In the
10273 explanation of the logical operations, S represents the incoming color
10274 index and D represents the index in the frame buffer. Standard
10275 C-language operators are used. As these bitwise operators suggest, the
10276 logical operation is applied independently to each bit pair of the
10277 source and destination indices or colors.
10279 `GL_INVALID_ENUM' is generated if OPCODE is not an accepted value.
10281 `GL_INVALID_OPERATION' is generated if `glLogicOp' is executed between
10282 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10284 (define-gl-procedure
10294 "Define a one-dimensional evaluator.
10297 Specifies the kind of values that are generated by the evaluator.
10298 Symbolic constants `GL_MAP1_VERTEX_3', `GL_MAP1_VERTEX_4',
10299 `GL_MAP1_INDEX', `GL_MAP1_COLOR_4', `GL_MAP1_NORMAL',
10300 `GL_MAP1_TEXTURE_COORD_1', `GL_MAP1_TEXTURE_COORD_2',
10301 `GL_MAP1_TEXTURE_COORD_3', and `GL_MAP1_TEXTURE_COORD_4' are
10307 Specify a linear mapping of U , as presented to `glEvalCoord1', to
10308 U^ , the variable that is evaluated by the equations specified by
10312 Specifies the number of floats or doubles between the beginning of
10313 one control point and the beginning of the next one in the data
10314 structure referenced in POINTS. This allows control points to be
10315 embedded in arbitrary data structures. The only constraint is that
10316 the values for a particular control point must occupy contiguous
10320 Specifies the number of control points. Must be positive.
10323 Specifies a pointer to the array of control points.
10325 Evaluators provide a way to use polynomial or rational polynomial
10326 mapping to produce vertices, normals, texture coordinates, and colors.
10327 The values produced by an evaluator are sent to further stages of GL
10328 processing just as if they had been presented using `glVertex',
10329 `glNormal', `glTexCoord', and `glColor' commands, except that the
10330 generated values do not update the current normal, texture coordinates,
10333 All polynomial or rational polynomial splines of any degree (up to the
10334 maximum degree supported by the GL implementation) can be described
10335 using evaluators. These include almost all splines used in computer
10336 graphics: B-splines, Bezier curves, Hermite splines, and so on.
10338 Evaluators define curves based on Bernstein polynomials. Define P\u2061(U^,)
10341 P\u2061(U^,)=ΣI=0NB_I,^N\u2061(U^,)\u2062R_I
10345 where R_I is a control point and B_I,^N\u2061(U^,) is the I th Bernstein
10346 polynomial of degree N (ORDER = N+1 ):
10348 B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
10352 0^0==1 and ((N), (0),,)==1
10354 `glMap1' is used to define the basis and to specify what kind of values
10355 are produced. Once defined, a map can be enabled and disabled by calling
10356 `glEnable' and `glDisable' with the map name, one of the nine predefined
10357 values for TARGET described below. `glEvalCoord1' evaluates the
10358 one-dimensional maps that are enabled. When `glEvalCoord1' presents a
10359 value U , the Bernstein functions are evaluated using U^ , where
10362 TARGET is a symbolic constant that indicates what kind of control points
10363 are provided in POINTS, and what output is generated when the map is
10364 evaluated. It can assume one of nine predefined values:
10367 Each control point is three floating-point values representing X ,
10368 Y , and Z . Internal `glVertex3' commands are generated when the
10372 Each control point is four floating-point values representing X , Y
10373 , Z , and W . Internal `glVertex4' commands are generated when the
10377 Each control point is a single floating-point value representing a
10378 color index. Internal `glIndex' commands are generated when the map
10379 is evaluated but the current index is not updated with the value of
10380 these `glIndex' commands.
10383 Each control point is four floating-point values representing red,
10384 green, blue, and alpha. Internal `glColor4' commands are generated
10385 when the map is evaluated but the current color is not updated with
10386 the value of these `glColor4' commands.
10389 Each control point is three floating-point values representing the
10390 X , Y , and Z components of a normal vector. Internal `glNormal'
10391 commands are generated when the map is evaluated but the current
10392 normal is not updated with the value of these `glNormal' commands.
10394 `GL_MAP1_TEXTURE_COORD_1'
10395 Each control point is a single floating-point value representing
10396 the S texture coordinate. Internal `glTexCoord1' commands are
10397 generated when the map is evaluated but the current texture
10398 coordinates are not updated with the value of these `glTexCoord'
10401 `GL_MAP1_TEXTURE_COORD_2'
10402 Each control point is two floating-point values representing the S
10403 and T texture coordinates. Internal `glTexCoord2' commands are
10404 generated when the map is evaluated but the current texture
10405 coordinates are not updated with the value of these `glTexCoord'
10408 `GL_MAP1_TEXTURE_COORD_3'
10409 Each control point is three floating-point values representing the
10410 S , T , and R texture coordinates. Internal `glTexCoord3' commands
10411 are generated when the map is evaluated but the current texture
10412 coordinates are not updated with the value of these `glTexCoord'
10415 `GL_MAP1_TEXTURE_COORD_4'
10416 Each control point is four floating-point values representing the S
10417 , T , R , and Q texture coordinates. Internal `glTexCoord4'
10418 commands are generated when the map is evaluated but the current
10419 texture coordinates are not updated with the value of these
10420 `glTexCoord' commands.
10422 STRIDE, ORDER, and POINTS define the array addressing for accessing the
10423 control points. POINTS is the location of the first control point, which
10424 occupies one, two, three, or four contiguous memory locations, depending
10425 on which map is being defined. ORDER is the number of control points in
10426 the array. STRIDE specifies how many float or double locations to
10427 advance the internal memory pointer to reach the next control point.
10429 `GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
10431 `GL_INVALID_VALUE' is generated if U1 is equal to U2.
10433 `GL_INVALID_VALUE' is generated if STRIDE is less than the number of
10434 values in a control point.
10436 `GL_INVALID_VALUE' is generated if ORDER is less than 1 or greater than
10437 the return value of `GL_MAX_EVAL_ORDER'.
10439 `GL_INVALID_OPERATION' is generated if `glMap1' is executed between the
10440 execution of `glBegin' and the corresponding execution of `glEnd'.
10442 `GL_INVALID_OPERATION' is generated if `glMap1' is called and the value
10443 of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
10445 (define-gl-procedure
10459 "Define a two-dimensional evaluator.
10462 Specifies the kind of values that are generated by the evaluator.
10463 Symbolic constants `GL_MAP2_VERTEX_3', `GL_MAP2_VERTEX_4',
10464 `GL_MAP2_INDEX', `GL_MAP2_COLOR_4', `GL_MAP2_NORMAL',
10465 `GL_MAP2_TEXTURE_COORD_1', `GL_MAP2_TEXTURE_COORD_2',
10466 `GL_MAP2_TEXTURE_COORD_3', and `GL_MAP2_TEXTURE_COORD_4' are
10472 Specify a linear mapping of U , as presented to `glEvalCoord2', to
10473 U^ , one of the two variables that are evaluated by the equations
10474 specified by this command. Initially, U1 is 0 and U2 is 1.
10477 Specifies the number of floats or doubles between the beginning of
10478 control point R_IJ and the beginning of control point R_(I+1,)\u2062J, ,
10479 where I and J are the U and V control point indices, respectively.
10480 This allows control points to be embedded in arbitrary data
10481 structures. The only constraint is that the values for a particular
10482 control point must occupy contiguous memory locations. The initial
10483 value of USTRIDE is 0.
10486 Specifies the dimension of the control point array in the U axis.
10487 Must be positive. The initial value is 1.
10492 Specify a linear mapping of V , as presented to `glEvalCoord2', to
10493 V^ , one of the two variables that are evaluated by the equations
10494 specified by this command. Initially, V1 is 0 and V2 is 1.
10497 Specifies the number of floats or doubles between the beginning of
10498 control point R_IJ and the beginning of control point R_I\u2061(J+1,), ,
10499 where I and J are the U and V control point indices, respectively.
10500 This allows control points to be embedded in arbitrary data
10501 structures. The only constraint is that the values for a particular
10502 control point must occupy contiguous memory locations. The initial
10503 value of VSTRIDE is 0.
10506 Specifies the dimension of the control point array in the V axis.
10507 Must be positive. The initial value is 1.
10510 Specifies a pointer to the array of control points.
10512 Evaluators provide a way to use polynomial or rational polynomial
10513 mapping to produce vertices, normals, texture coordinates, and colors.
10514 The values produced by an evaluator are sent on to further stages of GL
10515 processing just as if they had been presented using `glVertex',
10516 `glNormal', `glTexCoord', and `glColor' commands, except that the
10517 generated values do not update the current normal, texture coordinates,
10520 All polynomial or rational polynomial splines of any degree (up to the
10521 maximum degree supported by the GL implementation) can be described
10522 using evaluators. These include almost all surfaces used in computer
10523 graphics, including B-spline surfaces, NURBS surfaces, Bezier surfaces,
10526 Evaluators define surfaces based on bivariate Bernstein polynomials.
10527 Define P\u2061(U^,V^) as
10529 P\u2061(U^,V^)=ΣI=0NΣJ=0MB_I,^N\u2061(U^,)\u2062B_J,^M\u2061(V^,)\u2062R_IJ
10533 where R_IJ is a control point, B_I,^N\u2061(U^,) is the I th Bernstein
10534 polynomial of degree N (UORDER = N+1 )
10536 B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
10538 and B_J,^M\u2061(V^,) is the J th Bernstein polynomial of degree M (VORDER =
10541 B_J,^M\u2061(V^,)=((M), (J),,)\u2062V^,^J\u2062(1-V^,)^M-J,,
10543 Recall that 0^0==1 and ((N), (0),,)==1
10545 `glMap2' is used to define the basis and to specify what kind of values
10546 are produced. Once defined, a map can be enabled and disabled by calling
10547 `glEnable' and `glDisable' with the map name, one of the nine predefined
10548 values for TARGET, described below. When `glEvalCoord2' presents values
10549 U and V , the bivariate Bernstein polynomials are evaluated using U^ and
10556 TARGET is a symbolic constant that indicates what kind of control points
10557 are provided in POINTS, and what output is generated when the map is
10558 evaluated. It can assume one of nine predefined values:
10561 Each control point is three floating-point values representing X ,
10562 Y , and Z . Internal `glVertex3' commands are generated when the
10566 Each control point is four floating-point values representing X , Y
10567 , Z , and W . Internal `glVertex4' commands are generated when the
10571 Each control point is a single floating-point value representing a
10572 color index. Internal `glIndex' commands are generated when the map
10573 is evaluated but the current index is not updated with the value of
10574 these `glIndex' commands.
10577 Each control point is four floating-point values representing red,
10578 green, blue, and alpha. Internal `glColor4' commands are generated
10579 when the map is evaluated but the current color is not updated with
10580 the value of these `glColor4' commands.
10583 Each control point is three floating-point values representing the
10584 X , Y , and Z components of a normal vector. Internal `glNormal'
10585 commands are generated when the map is evaluated but the current
10586 normal is not updated with the value of these `glNormal' commands.
10588 `GL_MAP2_TEXTURE_COORD_1'
10589 Each control point is a single floating-point value representing
10590 the S texture coordinate. Internal `glTexCoord1' commands are
10591 generated when the map is evaluated but the current texture
10592 coordinates are not updated with the value of these `glTexCoord'
10595 `GL_MAP2_TEXTURE_COORD_2'
10596 Each control point is two floating-point values representing the S
10597 and T texture coordinates. Internal `glTexCoord2' commands are
10598 generated when the map is evaluated but the current texture
10599 coordinates are not updated with the value of these `glTexCoord'
10602 `GL_MAP2_TEXTURE_COORD_3'
10603 Each control point is three floating-point values representing the
10604 S , T , and R texture coordinates. Internal `glTexCoord3' commands
10605 are generated when the map is evaluated but the current texture
10606 coordinates are not updated with the value of these `glTexCoord'
10609 `GL_MAP2_TEXTURE_COORD_4'
10610 Each control point is four floating-point values representing the S
10611 , T , R , and Q texture coordinates. Internal `glTexCoord4'
10612 commands are generated when the map is evaluated but the current
10613 texture coordinates are not updated with the value of these
10614 `glTexCoord' commands.
10616 USTRIDE, UORDER, VSTRIDE, VORDER, and POINTS define the array addressing
10617 for accessing the control points. POINTS is the location of the first
10618 control point, which occupies one, two, three, or four contiguous memory
10619 locations, depending on which map is being defined. There are
10620 UORDER×VORDER control points in the array. USTRIDE specifies how many
10621 float or double locations are skipped to advance the internal memory
10622 pointer from control point R_I\u2062J, to control point R_(I+1,)\u2062J, . VSTRIDE
10623 specifies how many float or double locations are skipped to advance the
10624 internal memory pointer from control point R_I\u2062J, to control point
10627 `GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
10629 `GL_INVALID_VALUE' is generated if U1 is equal to U2, or if V1 is equal
10632 `GL_INVALID_VALUE' is generated if either USTRIDE or VSTRIDE is less
10633 than the number of values in a control point.
10635 `GL_INVALID_VALUE' is generated if either UORDER or VORDER is less than
10636 1 or greater than the return value of `GL_MAX_EVAL_ORDER'.
10638 `GL_INVALID_OPERATION' is generated if `glMap2' is executed between the
10639 execution of `glBegin' and the corresponding execution of `glEnd'.
10641 `GL_INVALID_OPERATION' is generated if `glMap2' is called and the value
10642 of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
10644 (define-gl-procedure
10650 (glUnmapBuffer (target GLenum) -> GLboolean))
10651 "Map a buffer object's data store.
10654 Specifies the target buffer object being mapped. The symbolic
10655 constant must be `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
10656 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
10659 Specifies the access policy, indicating whether it will be possible
10660 to read from, write to, or both read from and write to the buffer
10661 object's mapped data store. The symbolic constant must be
10662 `GL_READ_ONLY', `GL_WRITE_ONLY', or `GL_READ_WRITE'.
10664 `glMapBuffer' maps to the client's address space the entire data store
10665 of the buffer object currently bound to TARGET. The data can then be
10666 directly read and/or written relative to the returned pointer, depending
10667 on the specified ACCESS policy. If the GL is unable to map the buffer
10668 object's data store, `glMapBuffer' generates an error and returns
10669 `NULL'. This may occur for system-specific reasons, such as low virtual
10670 memory availability.
10672 If a mapped data store is accessed in a way inconsistent with the
10673 specified ACCESS policy, no error is generated, but performance may be
10674 negatively impacted and system errors, including program termination,
10675 may result. Unlike the USAGE parameter of `glBufferData', ACCESS is not
10676 a hint, and does in fact constrain the usage of the mapped data store on
10677 some GL implementations. In order to achieve the highest performance
10678 available, a buffer object's data store should be used in ways
10679 consistent with both its specified USAGE and ACCESS parameters.
10681 A mapped data store must be unmapped with `glUnmapBuffer' before its
10682 buffer object is used. Otherwise an error will be generated by any GL
10683 command that attempts to dereference the buffer object's data store.
10684 When a data store is unmapped, the pointer to its data store becomes
10685 invalid. `glUnmapBuffer' returns `GL_TRUE' unless the data store
10686 contents have become corrupt during the time the data store was mapped.
10687 This can occur for system-specific reasons that affect the availability
10688 of graphics memory, such as screen mode changes. In such situations,
10689 `GL_FALSE' is returned and the data store contents are undefined. An
10690 application must detect this rare condition and reinitialize the data
10693 A buffer object's mapped data store is automatically unmapped when the
10694 buffer object is deleted or its data store is recreated with
10697 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
10698 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
10699 `GL_PIXEL_UNPACK_BUFFER'.
10701 `GL_INVALID_ENUM' is generated if ACCESS is not `GL_READ_ONLY',
10702 `GL_WRITE_ONLY', or `GL_READ_WRITE'.
10704 `GL_OUT_OF_MEMORY' is generated when `glMapBuffer' is executed if the GL
10705 is unable to map the buffer object's data store. This may occur for a
10706 variety of system-specific reasons, such as the absence of sufficient
10707 remaining virtual memory.
10709 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
10710 is bound to TARGET.
10712 `GL_INVALID_OPERATION' is generated if `glMapBuffer' is executed for a
10713 buffer object whose data store is already mapped.
10715 `GL_INVALID_OPERATION' is generated if `glUnmapBuffer' is executed for a
10716 buffer object whose data store is not currently mapped.
10718 `GL_INVALID_OPERATION' is generated if `glMapBuffer' or `glUnmapBuffer'
10719 is executed between the execution of `glBegin' and the corresponding
10720 execution of `glEnd'.")
10722 (define-gl-procedure
10738 "Define a one- or two-dimensional mesh.
10741 Specifies the number of partitions in the grid range interval [U1,
10742 U2]. Must be positive.
10747 Specify the mappings for integer grid domain values I=0 and I=UN .
10750 Specifies the number of partitions in the grid range interval [V1,
10751 V2] (`glMapGrid2' only).
10756 Specify the mappings for integer grid domain values J=0 and J=VN
10757 (`glMapGrid2' only).
10759 `glMapGrid' and `glEvalMesh' are used together to efficiently generate
10760 and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
10761 steps through the integer domain of a one- or two-dimensional grid,
10762 whose range is the domain of the evaluation maps specified by `glMap1'
10765 `glMapGrid1' and `glMapGrid2' specify the linear grid mappings between
10766 the I (or I and J ) integer grid coordinates, to the U (or U and V )
10767 floating-point evaluation map coordinates. See `glMap1' and `glMap2' for
10768 details of how U and V coordinates are evaluated.
10770 `glMapGrid1' specifies a single linear mapping such that integer grid
10771 coordinate 0 maps exactly to U1, and integer grid coordinate UN maps
10772 exactly to U2. All other integer grid coordinates I are mapped so that
10774 U=I\u2061(U2-U1,)/UN+U1
10776 `glMapGrid2' specifies two such linear mappings. One maps integer grid
10777 coordinate I=0 exactly to U1, and integer grid coordinate I=UN exactly
10778 to U2. The other maps integer grid coordinate J=0 exactly to V1, and
10779 integer grid coordinate J=VN exactly to V2. Other integer grid
10780 coordinates I and J are mapped such that
10782 U=I\u2061(U2-U1,)/UN+U1
10784 V=J\u2061(V2-V1,)/VN+V1
10786 The mappings specified by `glMapGrid' are used identically by
10787 `glEvalMesh' and `glEvalPoint'.
10789 `GL_INVALID_VALUE' is generated if either UN or VN is not positive.
10791 `GL_INVALID_OPERATION' is generated if `glMapGrid' is executed between
10792 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10794 (define-gl-procedure
10807 "Specify material parameters for the lighting model.
10810 Specifies which face or faces are being updated. Must be one of
10811 `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
10814 Specifies the single-valued material parameter of the face or faces
10815 that is being updated. Must be `GL_SHININESS'.
10818 Specifies the value that parameter `GL_SHININESS' will be set to.
10820 `glMaterial' assigns values to material parameters. There are two
10821 matched sets of material parameters. One, the FRONT-FACING set, is used
10822 to shade points, lines, bitmaps, and all polygons (when two-sided
10823 lighting is disabled), or just front-facing polygons (when two-sided
10824 lighting is enabled). The other set, BACK-FACING, is used to shade
10825 back-facing polygons only when two-sided lighting is enabled. Refer to
10826 the `glLightModel' reference page for details concerning one- and
10827 two-sided lighting calculations.
10829 `glMaterial' takes three arguments. The first, FACE, specifies whether
10830 the `GL_FRONT' materials, the `GL_BACK' materials, or both
10831 `GL_FRONT_AND_BACK' materials will be modified. The second, PNAME,
10832 specifies which of several parameters in one or both sets will be
10833 modified. The third, PARAMS, specifies what value or values will be
10834 assigned to the specified parameter.
10836 Material parameters are used in the lighting equation that is optionally
10837 applied to each vertex. The equation is discussed in the `glLightModel'
10838 reference page. The parameters that can be specified using `glMaterial',
10839 and their interpretations by the lighting equation, are as follows:
10842 PARAMS contains four integer or floating-point values that specify
10843 the ambient RGBA reflectance of the material. Integer values are
10844 mapped linearly such that the most positive representable value
10845 maps to 1.0, and the most negative representable value maps to -1.0
10846 . Floating-point values are mapped directly. Neither integer nor
10847 floating-point values are clamped. The initial ambient reflectance
10848 for both front- and back-facing materials is (0.2, 0.2, 0.2, 1.0).
10851 PARAMS contains four integer or floating-point values that specify
10852 the diffuse RGBA reflectance of the material. Integer values are
10853 mapped linearly such that the most positive representable value
10854 maps to 1.0, and the most negative representable value maps to -1.0
10855 . Floating-point values are mapped directly. Neither integer nor
10856 floating-point values are clamped. The initial diffuse reflectance
10857 for both front- and back-facing materials is (0.8, 0.8, 0.8, 1.0).
10860 PARAMS contains four integer or floating-point values that specify
10861 the specular RGBA reflectance of the material. Integer values are
10862 mapped linearly such that the most positive representable value
10863 maps to 1.0, and the most negative representable value maps to -1.0
10864 . Floating-point values are mapped directly. Neither integer nor
10865 floating-point values are clamped. The initial specular reflectance
10866 for both front- and back-facing materials is (0, 0, 0, 1).
10869 PARAMS contains four integer or floating-point values that specify
10870 the RGBA emitted light intensity of the material. Integer values
10871 are mapped linearly such that the most positive representable value
10872 maps to 1.0, and the most negative representable value maps to -1.0
10873 . Floating-point values are mapped directly. Neither integer nor
10874 floating-point values are clamped. The initial emission intensity
10875 for both front- and back-facing materials is (0, 0, 0, 1).
10878 PARAMS is a single integer or floating-point value that specifies
10879 the RGBA specular exponent of the material. Integer and
10880 floating-point values are mapped directly. Only values in the range
10881 [0,128] are accepted. The initial specular exponent for both front-
10882 and back-facing materials is 0.
10884 `GL_AMBIENT_AND_DIFFUSE'
10885 Equivalent to calling `glMaterial' twice with the same parameter
10886 values, once with `GL_AMBIENT' and once with `GL_DIFFUSE'.
10889 PARAMS contains three integer or floating-point values specifying
10890 the color indices for ambient, diffuse, and specular lighting.
10891 These three values, and `GL_SHININESS', are the only material
10892 values used by the color index mode lighting equation. Refer to the
10893 `glLightModel' reference page for a discussion of color index
10896 `GL_INVALID_ENUM' is generated if either FACE or PNAME is not an
10899 `GL_INVALID_VALUE' is generated if a specular exponent outside the range
10900 [0,128] is specified.")
10902 (define-gl-procedure
10903 ((glMatrixMode (mode GLenum) -> void))
10904 "Specify which matrix is the current matrix.
10907 Specifies which matrix stack is the target for subsequent matrix
10908 operations. Three values are accepted: `GL_MODELVIEW',
10909 `GL_PROJECTION', and `GL_TEXTURE'. The initial value is
10910 `GL_MODELVIEW'. Additionally, if the `ARB_imaging' extension is
10911 supported, `GL_COLOR' is also accepted.
10913 `glMatrixMode' sets the current matrix mode. MODE can assume one of four
10917 Applies subsequent matrix operations to the modelview matrix stack.
10920 Applies subsequent matrix operations to the projection matrix
10924 Applies subsequent matrix operations to the texture matrix stack.
10927 Applies subsequent matrix operations to the color matrix stack.
10929 To find out which matrix stack is currently the target of all matrix
10930 operations, call `glGet' with argument `GL_MATRIX_MODE'. The initial
10931 value is `GL_MODELVIEW'.
10933 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
10935 `GL_INVALID_OPERATION' is generated if `glMatrixMode' is executed
10936 between the execution of `glBegin' and the corresponding execution of
10939 (define-gl-procedure
10942 (internalformat GLenum)
10946 "Define minmax table.
10949 The minmax table whose parameters are to be set. Must be
10953 The format of entries in the minmax table. Must be one of
10954 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
10955 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
10956 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
10957 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
10958 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
10959 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
10960 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
10961 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
10962 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
10965 If `GL_TRUE', pixels will be consumed by the minmax process and no
10966 drawing or texture loading will take place. If `GL_FALSE', pixels
10967 will proceed to the final conversion process after minmax.
10969 When `GL_MINMAX' is enabled, the RGBA components of incoming pixels are
10970 compared to the minimum and maximum values for each component, which are
10971 stored in the two-element minmax table. (The first element stores the
10972 minima, and the second element stores the maxima.) If a pixel component
10973 is greater than the corresponding component in the maximum element, then
10974 the maximum element is updated with the pixel component value. If a
10975 pixel component is less than the corresponding component in the minimum
10976 element, then the minimum element is updated with the pixel component
10977 value. (In both cases, if the internal format of the minmax table
10978 includes luminance, then the R color component of incoming pixels is
10979 used for comparison.) The contents of the minmax table may be retrieved
10980 at a later time by calling `glGetMinmax'. The minmax operation is
10981 enabled or disabled by calling `glEnable' or `glDisable', respectively,
10982 with an argument of `GL_MINMAX'.
10984 `glMinmax' redefines the current minmax table to have entries of the
10985 format specified by INTERNALFORMAT. The maximum element is initialized
10986 with the smallest possible component values, and the minimum element is
10987 initialized with the largest possible component values. The values in
10988 the previous minmax table, if any, are lost. If SINK is `GL_TRUE', then
10989 pixels are discarded after minmax; no further processing of the pixels
10990 takes place, and no drawing, texture loading, or pixel readback will
10995 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
10998 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
11001 `GL_INVALID_OPERATION' is generated if `glMinmax' is executed between
11002 the execution of `glBegin' and the corresponding execution of `glEnd'.")
11004 (define-gl-procedure
11005 ((glMultiDrawArrays
11009 (primcount GLsizei)
11012 "Render multiple sets of primitives from array data.
11015 Specifies what kind of primitives to render. Symbolic constants
11016 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
11017 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
11018 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
11021 Points to an array of starting indices in the enabled arrays.
11024 Points to an array of the number of indices to be rendered.
11027 Specifies the size of the first and count
11029 `glMultiDrawArrays' specifies multiple sets of geometric primitives with
11030 very few subroutine calls. Instead of calling a GL procedure to pass
11031 each individual vertex, normal, texture coordinate, edge flag, or color,
11032 you can prespecify separate arrays of vertices, normals, and colors and
11033 use them to construct a sequence of primitives with a single call to
11034 `glMultiDrawArrays'.
11036 `glMultiDrawArrays' behaves identically to `glDrawArrays' except that
11037 PRIMCOUNT separate ranges of elements are specified instead.
11039 When `glMultiDrawArrays' is called, it uses COUNT sequential elements
11040 from each enabled array to construct a sequence of geometric primitives,
11041 beginning with element FIRST. MODE specifies what kind of primitives are
11042 constructed, and how the array elements construct those primitives. If
11043 `GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
11045 Vertex attributes that are modified by `glMultiDrawArrays' have an
11046 unspecified value after `glMultiDrawArrays' returns. For example, if
11047 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
11048 after `glMultiDrawArrays' executes. Attributes that aren't modified
11049 remain well defined.
11051 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11053 `GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
11055 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
11056 bound to an enabled array and the buffer object's data store is
11059 `GL_INVALID_OPERATION' is generated if `glMultiDrawArrays' is executed
11060 between the execution of `glBegin' and the corresponding `glEnd'.")
11062 (define-gl-procedure
11063 ((glMultiDrawElements
11068 (primcount GLsizei)
11071 "Render multiple sets of primitives by specifying indices of array data
11075 Specifies what kind of primitives to render. Symbolic constants
11076 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
11077 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
11078 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
11081 Points to an array of the elements counts.
11084 Specifies the type of the values in INDICES. Must be one of
11085 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
11088 Specifies a pointer to the location where the indices are stored.
11091 Specifies the size of the COUNT array.
11093 `glMultiDrawElements' specifies multiple sets of geometric primitives
11094 with very few subroutine calls. Instead of calling a GL function to pass
11095 each individual vertex, normal, texture coordinate, edge flag, or color,
11096 you can prespecify separate arrays of vertices, normals, and so on, and
11097 use them to construct a sequence of primitives with a single call to
11098 `glMultiDrawElements'.
11100 `glMultiDrawElements' is identical in operation to `glDrawElements'
11101 except that PRIMCOUNT separate lists of elements are specified.
11103 Vertex attributes that are modified by `glMultiDrawElements' have an
11104 unspecified value after `glMultiDrawElements' returns. For example, if
11105 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
11106 after `glMultiDrawElements' executes. Attributes that aren't modified
11107 maintain their previous values.
11109 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11111 `GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
11113 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
11114 bound to an enabled array or the element array and the buffer object's
11115 data store is currently mapped.
11117 `GL_INVALID_OPERATION' is generated if `glMultiDrawElements' is executed
11118 between the execution of `glBegin' and the corresponding `glEnd'.")
11120 (define-gl-procedure
11121 ((glMultiTexCoord1i
11173 "Set the current texture coordinates.
11176 Specifies the texture unit whose coordinates should be modified.
11177 The number of texture units is implementation dependent, but must
11178 be at least two. Symbolic constant must be one of `GL_TEXTURE' I ,
11179 where i ranges from 0 to `GL_MAX_TEXTURE_COORDS' - 1, which is an
11180 implementation-dependent value.
11189 Specify S, T, R, and Q texture coordinates for TARGET texture unit.
11190 Not all parameters are present in all forms of the command.
11192 `glMultiTexCoord' specifies texture coordinates in one, two, three, or
11193 four dimensions. `glMultiTexCoord1' sets the current texture coordinates
11194 to (S,001) ; a call to `glMultiTexCoord2' sets them to (S,T01) .
11195 Similarly, `glMultiTexCoord3' specifies the texture coordinates as
11196 (S,TR1) , and `glMultiTexCoord4' defines all four components explicitly
11199 The current texture coordinates are part of the data that is associated
11200 with each vertex and with the current raster position. Initially, the
11201 values for (S,TRQ) are (0,001) .")
11203 (define-gl-procedure
11204 ((glMultMatrixd (m *) -> void))
11205 "Multiply the current matrix with the specified matrix.
11208 Points to 16 consecutive values that are used as the elements of a
11209 4×4 column-major matrix.
11211 `glMultMatrix' multiplies the current matrix with the one specified
11212 using M, and replaces the current matrix with the product.
11214 The current matrix is determined by the current matrix mode (see
11215 `glMatrixMode'). It is either the projection matrix, modelview matrix,
11216 or the texture matrix.
11218 `GL_INVALID_OPERATION' is generated if `glMultMatrix' is executed
11219 between the execution of `glBegin' and the corresponding execution of
11222 (define-gl-procedure
11223 ((glMultTransposeMatrixd (m *) -> void))
11224 "Multiply the current matrix with the specified row-major ordered matrix.
11227 Points to 16 consecutive values that are used as the elements of a
11228 4×4 row-major matrix.
11230 `glMultTransposeMatrix' multiplies the current matrix with the one
11231 specified using M, and replaces the current matrix with the product.
11233 The current matrix is determined by the current matrix mode (see
11234 `glMatrixMode'). It is either the projection matrix, modelview matrix,
11235 or the texture matrix.
11237 `GL_INVALID_OPERATION' is generated if `glMultTransposeMatrix' is
11238 executed between the execution of `glBegin' and the corresponding
11239 execution of `glEnd'.")
11241 (define-gl-procedure
11242 ((glNewList (list GLuint) (mode GLenum) -> void)
11243 (glEndList -> void))
11244 "Create or replace a display list.
11247 Specifies the display-list name.
11250 Specifies the compilation mode, which can be `GL_COMPILE' or
11251 `GL_COMPILE_AND_EXECUTE'.
11253 Display lists are groups of GL commands that have been stored for
11254 subsequent execution. Display lists are created with `glNewList'. All
11255 subsequent commands are placed in the display list, in the order issued,
11256 until `glEndList' is called.
11258 `glNewList' has two arguments. The first argument, LIST, is a positive
11259 integer that becomes the unique name for the display list. Names can be
11260 created and reserved with `glGenLists' and tested for uniqueness with
11261 `glIsList'. The second argument, MODE, is a symbolic constant that can
11262 assume one of two values:
11265 Commands are merely compiled.
11267 `GL_COMPILE_AND_EXECUTE'
11268 Commands are executed as they are compiled into the display list.
11270 Certain commands are not compiled into the display list but are executed
11271 immediately, regardless of the display-list mode. These commands are
11272 `glAreTexturesResident', `glColorPointer', `glDeleteLists',
11273 `glDeleteTextures', `glDisableClientState', `glEdgeFlagPointer',
11274 `glEnableClientState', `glFeedbackBuffer', `glFinish', `glFlush',
11275 `glGenLists', `glGenTextures', `glIndexPointer', `glInterleavedArrays',
11276 `glIsEnabled', `glIsList', `glIsTexture', `glNormalPointer',
11277 `glPopClientAttrib', `glPixelStore', `glPushClientAttrib',
11278 `glReadPixels', `glRenderMode', `glSelectBuffer', `glTexCoordPointer',
11279 `glVertexPointer', and all of the `glGet' commands.
11281 Similarly, `glTexImage1D', `glTexImage2D', and `glTexImage3D' are
11282 executed immediately and not compiled into the display list when their
11283 first argument is `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_1D', or
11284 `GL_PROXY_TEXTURE_3D', respectively.
11286 When the `ARB_imaging' extension is supported, `glHistogram' executes
11287 immediately when its argument is `GL_PROXY_HISTOGRAM'. Similarly,
11288 `glColorTable' executes immediately when its first argument is
11289 `GL_PROXY_COLOR_TABLE', `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
11290 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
11292 For OpenGL versions 1.3 and greater, or when the `ARB_multitexture'
11293 extension is supported, `glClientActiveTexture' is not compiled into
11294 display lists, but executed immediately.
11296 When `glEndList' is encountered, the display-list definition is
11297 completed by associating the list with the unique name LIST (specified
11298 in the `glNewList' command). If a display list with name LIST already
11299 exists, it is replaced only when `glEndList' is called.
11301 `GL_INVALID_VALUE' is generated if LIST is 0.
11303 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11305 `GL_INVALID_OPERATION' is generated if `glEndList' is called without a
11306 preceding `glNewList', or if `glNewList' is called while a display list
11309 `GL_INVALID_OPERATION' is generated if `glNewList' or `glEndList' is
11310 executed between the execution of `glBegin' and the corresponding
11311 execution of `glEnd'.
11313 `GL_OUT_OF_MEMORY' is generated if there is insufficient memory to
11314 compile the display list. If the GL version is 1.1 or greater, no change
11315 is made to the previous contents of the display list, if any, and no
11316 other change is made to the GL state. (It is as if no attempt had been
11317 made to create the new display list.)")
11319 (define-gl-procedure
11326 "Define an array of normals.
11329 Specifies the data type of each coordinate in the array. Symbolic
11330 constants `GL_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
11331 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
11334 Specifies the byte offset between consecutive normals. If STRIDE is
11335 0, the normals are understood to be tightly packed in the array.
11336 The initial value is 0.
11339 Specifies a pointer to the first coordinate of the first normal in
11340 the array. The initial value is 0.
11342 `glNormalPointer' specifies the location and data format of an array of
11343 normals to use when rendering. TYPE specifies the data type of each
11344 normal coordinate, and STRIDE specifies the byte stride from one normal
11345 to the next, allowing vertices and attributes to be packed into a single
11346 array or stored in separate arrays. (Single-array storage may be more
11347 efficient on some implementations; see `glInterleavedArrays'.)
11349 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
11350 target (see `glBindBuffer') while a normal array is specified, POINTER
11351 is treated as a byte offset into the buffer object's data store. Also,
11352 the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as normal
11353 vertex array client-side state (`GL_NORMAL_ARRAY_BUFFER_BINDING').
11355 When a normal array is specified, TYPE, STRIDE, and POINTER are saved as
11356 client-side state, in addition to the current vertex array buffer object
11359 To enable and disable the normal array, call `glEnableClientState' and
11360 `glDisableClientState' with the argument `GL_NORMAL_ARRAY'. If enabled,
11361 the normal array is used when `glDrawArrays', `glMultiDrawArrays',
11362 `glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
11363 `glArrayElement' is called.
11365 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
11367 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
11369 (define-gl-procedure
11382 "Set the current normal vector.
11389 Specify the X , Y , and Z coordinates of the new current normal.
11390 The initial value of the current normal is the unit vector, (0, 0,
11395 The current normal is set to the given coordinates whenever `glNormal'
11396 is issued. Byte, short, or integer arguments are converted to
11397 floating-point format with a linear mapping that maps the most positive
11398 representable integer value to 1.0 and the most negative representable
11399 integer value to -1.0 .
11401 Normals specified with `glNormal' need not have unit length. If
11402 `GL_NORMALIZE' is enabled, then normals of any length specified with
11403 `glNormal' are normalized after transformation. If `GL_RESCALE_NORMAL'
11404 is enabled, normals are scaled by a scaling factor derived from the
11405 modelview matrix. `GL_RESCALE_NORMAL' requires that the originally
11406 specified normals were of unit length, and that the modelview matrix
11407 contain only uniform scales for proper results. To enable and disable
11408 normalization, call `glEnable' and `glDisable' with either
11409 `GL_NORMALIZE' or `GL_RESCALE_NORMAL'. Normalization is initially
11412 (define-gl-procedure
11422 "Multiply the current matrix with an orthographic matrix.
11427 Specify the coordinates for the left and right vertical clipping
11433 Specify the coordinates for the bottom and top horizontal clipping
11439 Specify the distances to the nearer and farther depth clipping
11440 planes. These values are negative if the plane is to be behind the
11443 `glOrtho' describes a transformation that produces a parallel
11444 projection. The current matrix (see `glMatrixMode') is multiplied by
11445 this matrix and the result replaces the current matrix, as if
11446 `glMultMatrix' were called with the following matrix as its argument:
11448 ((2/RIGHT-LEFT,, 0 0 T_X,), (0 2/TOP-BOTTOM,, 0 T_Y,), (0 0
11449 -2/FARVAL-NEARVAL,, T_Z,), (0 0 0 1),)
11451 where T_X=-RIGHT+LEFT,/RIGHT-LEFT,, T_Y=-TOP+BOTTOM,/TOP-BOTTOM,,
11452 T_Z=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
11454 Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
11455 and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
11456 that are mapped to the lower left and upper right corners of the window,
11457 respectively, assuming that the eye is located at (0, 0, 0). -FARVAL
11458 specifies the location of the far clipping plane. Both NEARVAL and
11459 FARVAL can be either positive or negative.
11461 Use `glPushMatrix' and `glPopMatrix' to save and restore the current
11464 `GL_INVALID_VALUE' is generated if LEFT = RIGHT, or BOTTOM = TOP, or
11467 `GL_INVALID_OPERATION' is generated if `glOrtho' is executed between the
11468 execution of `glBegin' and the corresponding execution of `glEnd'.")
11470 (define-gl-procedure
11471 ((glPassThrough (token GLfloat) -> void))
11472 "Place a marker in the feedback buffer.
11475 Specifies a marker value to be placed in the feedback buffer
11476 following a `GL_PASS_THROUGH_TOKEN'.
11480 Feedback is a GL render mode. The mode is selected by calling
11481 `glRenderMode' with `GL_FEEDBACK'. When the GL is in feedback mode, no
11482 pixels are produced by rasterization. Instead, information about
11483 primitives that would have been rasterized is fed back to the
11484 application using the GL. See the `glFeedbackBuffer' reference page for
11485 a description of the feedback buffer and the values in it.
11487 `glPassThrough' inserts a user-defined marker in the feedback buffer
11488 when it is executed in feedback mode. TOKEN is returned as if it were a
11489 primitive; it is indicated with its own unique identifying value:
11490 `GL_PASS_THROUGH_TOKEN'. The order of `glPassThrough' commands with
11491 respect to the specification of graphics primitives is maintained.
11493 `GL_INVALID_OPERATION' is generated if `glPassThrough' is executed
11494 between the execution of `glBegin' and the corresponding execution of
11497 (define-gl-procedure
11508 "Set pixel storage modes.
11511 Specifies the symbolic name of the parameter to be set. Six values
11512 affect the packing of pixel data into memory: `GL_PACK_SWAP_BYTES',
11513 `GL_PACK_LSB_FIRST', `GL_PACK_ROW_LENGTH', `GL_PACK_IMAGE_HEIGHT',
11514 `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', `GL_PACK_SKIP_IMAGES',
11515 and `GL_PACK_ALIGNMENT'. Six more affect the unpacking of pixel
11516 data FROM memory: `GL_UNPACK_SWAP_BYTES', `GL_UNPACK_LSB_FIRST',
11517 `GL_UNPACK_ROW_LENGTH', `GL_UNPACK_IMAGE_HEIGHT',
11518 `GL_UNPACK_SKIP_PIXELS', `GL_UNPACK_SKIP_ROWS',
11519 `GL_UNPACK_SKIP_IMAGES', and `GL_UNPACK_ALIGNMENT'.
11522 Specifies the value that PNAME is set to.
11524 `glPixelStore' sets pixel storage modes that affect the operation of
11525 subsequent `glDrawPixels' and `glReadPixels' as well as the unpacking of
11526 polygon stipple patterns (see `glPolygonStipple'), bitmaps (see
11527 `glBitmap'), texture patterns (see `glTexImage1D', `glTexImage2D',
11528 `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
11529 `glTexSubImage3D'). Additionally, if the `ARB_imaging' extension is
11530 supported, pixel storage modes affect convolution filters (see
11531 `glConvolutionFilter1D', `glConvolutionFilter2D', and
11532 `glSeparableFilter2D', color table (see `glColorTable', and
11533 `glColorSubTable', and unpacking histogram (See `glHistogram'), and
11534 minmax (See `glMinmax') data.
11536 PNAME is a symbolic constant indicating the parameter to be set, and
11537 PARAM is the new value. Six of the twelve storage parameters affect how
11538 pixel data is returned to client memory. They are as follows:
11540 `GL_PACK_SWAP_BYTES'
11541 If true, byte ordering for multibyte color components, depth
11542 components, color indices, or stencil indices is reversed. That is,
11543 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
11544 it is stored in memory as B_3 , B_2 , B_1 , B_0 if
11545 `GL_PACK_SWAP_BYTES' is true. `GL_PACK_SWAP_BYTES' has no effect on
11546 the memory order of components within a pixel, only on the order of
11547 bytes within components or indices. For example, the three
11548 components of a `GL_RGB' format pixel are always stored with red
11549 first, green second, and blue third, regardless of the value of
11550 `GL_PACK_SWAP_BYTES'.
11552 `GL_PACK_LSB_FIRST'
11553 If true, bits are ordered within a byte from least significant to
11554 most significant; otherwise, the first bit in each byte is the most
11555 significant one. This parameter is significant for bitmap data
11558 `GL_PACK_ROW_LENGTH'
11559 If greater than 0, `GL_PACK_ROW_LENGTH' defines the number of
11560 pixels in a row. If the first pixel of a row is placed at location
11561 P in memory, then the location of the first pixel of the next row
11562 is obtained by skipping
11564 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
11566 components or indices, where N is the number of components or
11567 indices in a pixel, L is the number of pixels in a row
11568 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11569 to the pixel routine otherwise), A is the value of
11570 `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
11571 component (if A<S , then it is as if A=S ). In the case of 1-bit
11572 values, the location of the next row is obtained by skipping
11574 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
11576 components or indices.
11578 The word COMPONENT in this description refers to the nonindex
11579 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11580 for example, has three components per pixel: first red, then green,
11583 `GL_PACK_IMAGE_HEIGHT'
11584 If greater than 0, `GL_PACK_IMAGE_HEIGHT' defines the number of
11585 pixels in an image three-dimensional texture volume, where
11586 ``image'' is defined by all pixels sharing the same third dimension
11587 index. If the first pixel of a row is placed at location P in
11588 memory, then the location of the first pixel of the next row is
11589 obtained by skipping
11591 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
11593 components or indices, where N is the number of components or
11594 indices in a pixel, L is the number of pixels in a row
11595 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11596 to `glTexImage3D' otherwise), H is the number of rows in a pixel
11597 image (`GL_PACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
11598 argument to the `glTexImage3D' routine otherwise), A is the value
11599 of `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
11600 component (if A<S , then it is as if A=S ).
11602 The word COMPONENT in this description refers to the nonindex
11603 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11604 for example, has three components per pixel: first red, then green,
11607 `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', and `GL_PACK_SKIP_IMAGES'
11608 These values are provided as a convenience to the programmer; they
11609 provide no functionality that cannot be duplicated simply by
11610 incrementing the pointer passed to `glReadPixels'. Setting
11611 `GL_PACK_SKIP_PIXELS' to I is equivalent to incrementing the
11612 pointer by I\u2062N components or indices, where N is the number of
11613 components or indices in each pixel. Setting `GL_PACK_SKIP_ROWS' to
11614 J is equivalent to incrementing the pointer by J\u2062M components or
11615 indices, where M is the number of components or indices per row, as
11616 just computed in the `GL_PACK_ROW_LENGTH' section. Setting
11617 `GL_PACK_SKIP_IMAGES' to K is equivalent to incrementing the
11618 pointer by K\u2062P , where P is the number of components or indices per
11619 image, as computed in the `GL_PACK_IMAGE_HEIGHT' section.
11621 `GL_PACK_ALIGNMENT'
11622 Specifies the alignment requirements for the start of each pixel
11623 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
11624 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
11625 start on double-word boundaries).
11627 The other six of the twelve storage parameters affect how pixel data is
11628 read from client memory. These values are significant for
11629 `glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
11630 `glTexSubImage1D', `glTexSubImage2D', `glTexSubImage3D', `glBitmap', and
11631 `glPolygonStipple'.
11633 Additionally, if the `ARB_imaging' extension is supported,
11634 `glColorTable', `glColorSubTable', `glConvolutionFilter1D',
11635 `glConvolutionFilter2D', and `glSeparableFilter2D'. They are as follows:
11637 `GL_UNPACK_SWAP_BYTES'
11638 If true, byte ordering for multibyte color components, depth
11639 components, color indices, or stencil indices is reversed. That is,
11640 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
11641 it is taken from memory as B_3 , B_2 , B_1 , B_0 if
11642 `GL_UNPACK_SWAP_BYTES' is true. `GL_UNPACK_SWAP_BYTES' has no
11643 effect on the memory order of components within a pixel, only on
11644 the order of bytes within components or indices. For example, the
11645 three components of a `GL_RGB' format pixel are always stored with
11646 red first, green second, and blue third, regardless of the value of
11647 `GL_UNPACK_SWAP_BYTES'.
11649 `GL_UNPACK_LSB_FIRST'
11650 If true, bits are ordered within a byte from least significant to
11651 most significant; otherwise, the first bit in each byte is the most
11652 significant one. This is relevant only for bitmap data.
11654 `GL_UNPACK_ROW_LENGTH'
11655 If greater than 0, `GL_UNPACK_ROW_LENGTH' defines the number of
11656 pixels in a row. If the first pixel of a row is placed at location
11657 P in memory, then the location of the first pixel of the next row
11658 is obtained by skipping
11660 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
11662 components or indices, where N is the number of components or
11663 indices in a pixel, L is the number of pixels in a row
11664 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11665 to the pixel routine otherwise), A is the value of
11666 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
11667 component (if A<S , then it is as if A=S ). In the case of 1-bit
11668 values, the location of the next row is obtained by skipping
11670 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
11672 components or indices.
11674 The word COMPONENT in this description refers to the nonindex
11675 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11676 for example, has three components per pixel: first red, then green,
11679 `GL_UNPACK_IMAGE_HEIGHT'
11680 If greater than 0, `GL_UNPACK_IMAGE_HEIGHT' defines the number of
11681 pixels in an image of a three-dimensional texture volume. Where
11682 ``image'' is defined by all pixel sharing the same third dimension
11683 index. If the first pixel of a row is placed at location P in
11684 memory, then the location of the first pixel of the next row is
11685 obtained by skipping
11687 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
11689 components or indices, where N is the number of components or
11690 indices in a pixel, L is the number of pixels in a row
11691 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11692 to `glTexImage3D' otherwise), H is the number of rows in an image
11693 (`GL_UNPACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
11694 argument to `glTexImage3D' otherwise), A is the value of
11695 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
11696 component (if A<S , then it is as if A=S ).
11698 The word COMPONENT in this description refers to the nonindex
11699 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11700 for example, has three components per pixel: first red, then green,
11703 `GL_UNPACK_SKIP_PIXELS' and `GL_UNPACK_SKIP_ROWS'
11704 These values are provided as a convenience to the programmer; they
11705 provide no functionality that cannot be duplicated by incrementing
11706 the pointer passed to `glDrawPixels', `glTexImage1D',
11707 `glTexImage2D', `glTexSubImage1D', `glTexSubImage2D', `glBitmap',
11708 or `glPolygonStipple'. Setting `GL_UNPACK_SKIP_PIXELS' to I is
11709 equivalent to incrementing the pointer by I\u2062N components or
11710 indices, where N is the number of components or indices in each
11711 pixel. Setting `GL_UNPACK_SKIP_ROWS' to J is equivalent to
11712 incrementing the pointer by J\u2062K components or indices, where K is
11713 the number of components or indices per row, as just computed in
11714 the `GL_UNPACK_ROW_LENGTH' section.
11716 `GL_UNPACK_ALIGNMENT'
11717 Specifies the alignment requirements for the start of each pixel
11718 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
11719 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
11720 start on double-word boundaries).
11722 The following table gives the type, initial value, and range of valid
11723 values for each storage parameter that can be set with `glPixelStore'.
11728 *Type*, *Initial Value*, *Valid Range*
11730 `GL_PACK_SWAP_BYTES'
11731 boolean , false , true or false
11733 `GL_PACK_LSB_FIRST'
11734 boolean , false , true or false
11736 `GL_PACK_ROW_LENGTH'
11737 integer , 0 , [0,∞)
11739 `GL_PACK_IMAGE_HEIGHT'
11740 integer , 0 , [0,∞)
11742 `GL_PACK_SKIP_ROWS'
11743 integer , 0 , [0,∞)
11745 `GL_PACK_SKIP_PIXELS'
11746 integer , 0 , [0,∞)
11748 `GL_PACK_SKIP_IMAGES'
11749 integer , 0 , [0,∞)
11751 `GL_PACK_ALIGNMENT'
11752 integer , 4 , 1, 2, 4, or 8
11754 `GL_UNPACK_SWAP_BYTES'
11755 boolean , false , true or false
11757 `GL_UNPACK_LSB_FIRST'
11758 boolean , false , true or false
11760 `GL_UNPACK_ROW_LENGTH'
11761 integer , 0 , [0,∞)
11763 `GL_UNPACK_IMAGE_HEIGHT'
11764 integer , 0 , [0,∞)
11766 `GL_UNPACK_SKIP_ROWS'
11767 integer , 0 , [0,∞)
11769 `GL_UNPACK_SKIP_PIXELS'
11770 integer , 0 , [0,∞)
11772 `GL_UNPACK_SKIP_IMAGES'
11773 integer , 0 , [0,∞)
11775 `GL_UNPACK_ALIGNMENT'
11776 integer , 4 , 1, 2, 4, or 8
11778 `glPixelStoref' can be used to set any pixel store parameter. If the
11779 parameter type is boolean, then if PARAM is 0, the parameter is false;
11780 otherwise it is set to true. If PNAME is a integer type parameter, PARAM
11781 is rounded to the nearest integer.
11783 Likewise, `glPixelStorei' can also be used to set any of the pixel store
11784 parameters. Boolean parameters are set to false if PARAM is 0 and true
11787 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
11789 `GL_INVALID_VALUE' is generated if a negative row length, pixel skip, or
11790 row skip value is specified, or if alignment is specified as other than
11793 `GL_INVALID_OPERATION' is generated if `glPixelStore' is executed
11794 between the execution of `glBegin' and the corresponding execution of
11797 (define-gl-procedure
11808 "Set pixel transfer modes.
11811 Specifies the symbolic name of the pixel transfer parameter to be
11812 set. Must be one of the following: `GL_MAP_COLOR',
11813 `GL_MAP_STENCIL', `GL_INDEX_SHIFT', `GL_INDEX_OFFSET',
11814 `GL_RED_SCALE', `GL_RED_BIAS', `GL_GREEN_SCALE', `GL_GREEN_BIAS',
11815 `GL_BLUE_SCALE', `GL_BLUE_BIAS', `GL_ALPHA_SCALE', `GL_ALPHA_BIAS',
11816 `GL_DEPTH_SCALE', or `GL_DEPTH_BIAS'.
11818 Additionally, if the `ARB_imaging' extension is supported, the
11819 following symbolic names are accepted:
11820 `GL_POST_COLOR_MATRIX_RED_SCALE',
11821 `GL_POST_COLOR_MATRIX_GREEN_SCALE',
11822 `GL_POST_COLOR_MATRIX_BLUE_SCALE',
11823 `GL_POST_COLOR_MATRIX_ALPHA_SCALE',
11824 `GL_POST_COLOR_MATRIX_RED_BIAS', `GL_POST_COLOR_MATRIX_GREEN_BIAS',
11825 `GL_POST_COLOR_MATRIX_BLUE_BIAS',
11826 `GL_POST_COLOR_MATRIX_ALPHA_BIAS', `GL_POST_CONVOLUTION_RED_SCALE',
11827 `GL_POST_CONVOLUTION_GREEN_SCALE',
11828 `GL_POST_CONVOLUTION_BLUE_SCALE',
11829 `GL_POST_CONVOLUTION_ALPHA_SCALE', `GL_POST_CONVOLUTION_RED_BIAS',
11830 `GL_POST_CONVOLUTION_GREEN_BIAS', `GL_POST_CONVOLUTION_BLUE_BIAS',
11831 and `GL_POST_CONVOLUTION_ALPHA_BIAS'.
11834 Specifies the value that PNAME is set to.
11836 `glPixelTransfer' sets pixel transfer modes that affect the operation of
11837 subsequent `glCopyPixels', `glCopyTexImage1D', `glCopyTexImage2D',
11838 `glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D',
11839 `glDrawPixels', `glReadPixels', `glTexImage1D', `glTexImage2D',
11840 `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', and
11841 `glTexSubImage3D' commands. Additionally, if the `ARB_imaging' subset is
11842 supported, the routines `glColorTable', `glColorSubTable',
11843 `glConvolutionFilter1D', `glConvolutionFilter2D', `glHistogram',
11844 `glMinmax', and `glSeparableFilter2D' are also affected. The algorithms
11845 that are specified by pixel transfer modes operate on pixels after they
11846 are read from the frame buffer (`glCopyPixels'`glCopyTexImage1D',
11847 `glCopyTexImage2D', `glCopyTexSubImage1D', `glCopyTexSubImage2D',
11848 `glCopyTexSubImage3D', and `glReadPixels'), or unpacked from client
11849 memory (`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
11850 `glTexSubImage1D', `glTexSubImage2D', and `glTexSubImage3D'). Pixel
11851 transfer operations happen in the same order, and in the same manner,
11852 regardless of the command that resulted in the pixel operation. Pixel
11853 storage modes (see `glPixelStore') control the unpacking of pixels being
11854 read from client memory and the packing of pixels being written back
11855 into client memory.
11857 Pixel transfer operations handle four fundamental pixel types: COLOR,
11858 COLOR INDEX, DEPTH, and STENCIL. COLOR pixels consist of four
11859 floating-point values with unspecified mantissa and exponent sizes,
11860 scaled such that 0 represents zero intensity and 1 represents full
11861 intensity. COLOR INDICES comprise a single fixed-point value, with
11862 unspecified precision to the right of the binary point. DEPTH pixels
11863 comprise a single floating-point value, with unspecified mantissa and
11864 exponent sizes, scaled such that 0.0 represents the minimum depth buffer
11865 value, and 1.0 represents the maximum depth buffer value. Finally,
11866 STENCIL pixels comprise a single fixed-point value, with unspecified
11867 precision to the right of the binary point.
11869 The pixel transfer operations performed on the four basic pixel types
11873 Each of the four color components is multiplied by a scale factor,
11874 then added to a bias factor. That is, the red component is
11875 multiplied by `GL_RED_SCALE', then added to `GL_RED_BIAS'; the
11876 green component is multiplied by `GL_GREEN_SCALE', then added to
11877 `GL_GREEN_BIAS'; the blue component is multiplied by
11878 `GL_BLUE_SCALE', then added to `GL_BLUE_BIAS'; and the alpha
11879 component is multiplied by `GL_ALPHA_SCALE', then added to
11880 `GL_ALPHA_BIAS'. After all four color components are scaled and
11881 biased, each is clamped to the range [0,1] . All color, scale, and
11882 bias values are specified with `glPixelTransfer'.
11884 If `GL_MAP_COLOR' is true, each color component is scaled by the
11885 size of the corresponding color-to-color map, then replaced by the
11886 contents of that map indexed by the scaled component. That is, the
11887 red component is scaled by `GL_PIXEL_MAP_R_TO_R_SIZE', then
11888 replaced by the contents of `GL_PIXEL_MAP_R_TO_R' indexed by
11889 itself. The green component is scaled by
11890 `GL_PIXEL_MAP_G_TO_G_SIZE', then replaced by the contents of
11891 `GL_PIXEL_MAP_G_TO_G' indexed by itself. The blue component is
11892 scaled by `GL_PIXEL_MAP_B_TO_B_SIZE', then replaced by the contents
11893 of `GL_PIXEL_MAP_B_TO_B' indexed by itself. And the alpha component
11894 is scaled by `GL_PIXEL_MAP_A_TO_A_SIZE', then replaced by the
11895 contents of `GL_PIXEL_MAP_A_TO_A' indexed by itself. All components
11896 taken from the maps are then clamped to the range [0,1] .
11897 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
11898 the various maps are specified with `glPixelMap'.
11900 If the `ARB_imaging' extension is supported, each of the four color
11901 components may be scaled and biased after transformation by the
11902 color matrix. That is, the red component is multiplied by
11903 `GL_POST_COLOR_MATRIX_RED_SCALE', then added to
11904 `GL_POST_COLOR_MATRIX_RED_BIAS'; the green component is multiplied
11905 by `GL_POST_COLOR_MATRIX_GREEN_SCALE', then added to
11906 `GL_POST_COLOR_MATRIX_GREEN_BIAS'; the blue component is multiplied
11907 by `GL_POST_COLOR_MATRIX_BLUE_SCALE', then added to
11908 `GL_POST_COLOR_MATRIX_BLUE_BIAS'; and the alpha component is
11909 multiplied by `GL_POST_COLOR_MATRIX_ALPHA_SCALE', then added to
11910 `GL_POST_COLOR_MATRIX_ALPHA_BIAS'. After all four color components
11911 are scaled and biased, each is clamped to the range [0,1] .
11913 Similarly, if the `ARB_imaging' extension is supported, each of the
11914 four color components may be scaled and biased after processing by
11915 the enabled convolution filter. That is, the red component is
11916 multiplied by `GL_POST_CONVOLUTION_RED_SCALE', then added to
11917 `GL_POST_CONVOLUTION_RED_BIAS'; the green component is multiplied
11918 by `GL_POST_CONVOLUTION_GREEN_SCALE', then added to
11919 `GL_POST_CONVOLUTION_GREEN_BIAS'; the blue component is multiplied
11920 by `GL_POST_CONVOLUTION_BLUE_SCALE', then added to
11921 `GL_POST_CONVOLUTION_BLUE_BIAS'; and the alpha component is
11922 multiplied by `GL_POST_CONVOLUTION_ALPHA_SCALE', then added to
11923 `GL_POST_CONVOLUTION_ALPHA_BIAS'. After all four color components
11924 are scaled and biased, each is clamped to the range [0,1] .
11927 Each color index is shifted left by `GL_INDEX_SHIFT' bits; any bits
11928 beyond the number of fraction bits carried by the fixed-point index
11929 are filled with zeros. If `GL_INDEX_SHIFT' is negative, the shift
11930 is to the right, again zero filled. Then `GL_INDEX_OFFSET' is added
11931 to the index. `GL_INDEX_SHIFT' and `GL_INDEX_OFFSET' are specified
11932 with `glPixelTransfer'.
11934 From this point, operation diverges depending on the required
11935 format of the resulting pixels. If the resulting pixels are to be
11936 written to a color index buffer, or if they are being read back to
11937 client memory in `GL_COLOR_INDEX' format, the pixels continue to be
11938 treated as indices. If `GL_MAP_COLOR' is true, each index is masked
11939 by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_I_SIZE', then replaced by
11940 the contents of `GL_PIXEL_MAP_I_TO_I' indexed by the masked value.
11941 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
11942 the index map is specified with `glPixelMap'.
11944 If the resulting pixels are to be written to an RGBA color buffer,
11945 or if they are read back to client memory in a format other than
11946 `GL_COLOR_INDEX', the pixels are converted from indices to colors
11947 by referencing the four maps `GL_PIXEL_MAP_I_TO_R',
11948 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
11949 `GL_PIXEL_MAP_I_TO_A'. Before being dereferenced, the index is
11950 masked by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_R_SIZE' for the red
11951 map, `GL_PIXEL_MAP_I_TO_G_SIZE' for the green map,
11952 `GL_PIXEL_MAP_I_TO_B_SIZE' for the blue map, and
11953 `GL_PIXEL_MAP_I_TO_A_SIZE' for the alpha map. All components taken
11954 from the maps are then clamped to the range [0,1] . The contents of
11955 the four maps is specified with `glPixelMap'.
11958 Each depth value is multiplied by `GL_DEPTH_SCALE', added to
11959 `GL_DEPTH_BIAS', then clamped to the range [0,1] .
11962 Each index is shifted `GL_INDEX_SHIFT' bits just as a color index
11963 is, then added to `GL_INDEX_OFFSET'. If `GL_MAP_STENCIL' is true,
11964 each index is masked by 2^N-1 , where N is
11965 `GL_PIXEL_MAP_S_TO_S_SIZE', then replaced by the contents of
11966 `GL_PIXEL_MAP_S_TO_S' indexed by the masked value.
11968 The following table gives the type, initial value, and range of valid
11969 values for each of the pixel transfer parameters that are set with
11975 *Type*, *Initial Value*, *Valid Range*
11978 boolean , false , true/false
11981 boolean , false , true/false
11984 integer , 0 , (-∞,∞)
11987 integer , 0 , (-∞,∞)
12019 `GL_POST_COLOR_MATRIX_RED_SCALE'
12022 `GL_POST_COLOR_MATRIX_GREEN_SCALE'
12025 `GL_POST_COLOR_MATRIX_BLUE_SCALE'
12028 `GL_POST_COLOR_MATRIX_ALPHA_SCALE'
12031 `GL_POST_COLOR_MATRIX_RED_BIAS'
12034 `GL_POST_COLOR_MATRIX_GREEN_BIAS'
12037 `GL_POST_COLOR_MATRIX_BLUE_BIAS'
12040 `GL_POST_COLOR_MATRIX_ALPHA_BIAS'
12043 `GL_POST_CONVOLUTION_RED_SCALE'
12046 `GL_POST_CONVOLUTION_GREEN_SCALE'
12049 `GL_POST_CONVOLUTION_BLUE_SCALE'
12052 `GL_POST_CONVOLUTION_ALPHA_SCALE'
12055 `GL_POST_CONVOLUTION_RED_BIAS'
12058 `GL_POST_CONVOLUTION_GREEN_BIAS'
12061 `GL_POST_CONVOLUTION_BLUE_BIAS'
12064 `GL_POST_CONVOLUTION_ALPHA_BIAS'
12067 `glPixelTransferf' can be used to set any pixel transfer parameter. If
12068 the parameter type is boolean, 0 implies false and any other value
12069 implies true. If PNAME is an integer parameter, PARAM is rounded to the
12072 Likewise, `glPixelTransferi' can be used to set any of the pixel
12073 transfer parameters. Boolean parameters are set to false if PARAM is 0
12074 and to true otherwise. PARAM is converted to floating point before being
12075 assigned to real-valued parameters.
12077 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
12079 `GL_INVALID_OPERATION' is generated if `glPixelTransfer' is executed
12080 between the execution of `glBegin' and the corresponding execution of
12083 (define-gl-procedure
12089 "Specify the pixel zoom factors.
12094 Specify the X and Y zoom factors for pixel write operations.
12096 `glPixelZoom' specifies values for the X and Y zoom factors. During the
12097 execution of `glDrawPixels' or `glCopyPixels', if (XR , YR ) is the
12098 current raster position, and a given element is in the M th row and N th
12099 column of the pixel rectangle, then pixels whose centers are in the
12100 rectangle with corners at
12102 (XR+N·XFACTOR , YR+M·YFACTOR )
12104 (XR+(N+1,)·XFACTOR , YR+(M+1,)·YFACTOR )
12106 are candidates for replacement. Any pixel whose center lies on the
12107 bottom or left edge of this rectangular region is also modified.
12109 Pixel zoom factors are not limited to positive values. Negative zoom
12110 factors reflect the resulting image about the current raster position.
12112 `GL_INVALID_OPERATION' is generated if `glPixelZoom' is executed between
12113 the execution of `glBegin' and the corresponding execution of `glEnd'.")
12115 (define-gl-procedure
12116 ((glPointParameterf
12126 "Specify point parameters.
12129 Specifies a single-valued point parameter. `GL_POINT_SIZE_MIN',
12130 `GL_POINT_SIZE_MAX', `GL_POINT_FADE_THRESHOLD_SIZE', and
12131 `GL_POINT_SPRITE_COORD_ORIGIN' are accepted.
12134 Specifies the value that PNAME will be set to.
12136 The following values are accepted for PNAME:
12138 `GL_POINT_SIZE_MIN'
12141 PARAMS is a single floating-point value that specifies the minimum
12142 point size. The default value is 0.0.
12144 `GL_POINT_SIZE_MAX'
12147 PARAMS is a single floating-point value that specifies the maximum
12148 point size. The default value is 1.0.
12150 `GL_POINT_FADE_THRESHOLD_SIZE'
12153 PARAMS is a single floating-point value that specifies the
12154 threshold value to which point sizes are clamped if they exceed the
12155 specified value. The default value is 1.0.
12157 `GL_POINT_DISTANCE_ATTENUATION'
12160 PARAMS is an array of three floating-point values that specify the
12161 coefficients used for scaling the computed point size. The default
12162 values are (1,00) .
12164 `GL_POINT_SPRITE_COORD_ORIGIN'
12167 PARAMS is a single enum specifying the point sprite texture
12168 coordinate origin, either `GL_LOWER_LEFT' or `GL_UPPER_LEFT'. The
12169 default value is `GL_UPPER_LEFT'.
12171 `GL_INVALID_VALUE' is generated If the value specified for
12172 `GL_POINT_SIZE_MIN', `GL_POINT_SIZE_MAX', or
12173 `GL_POINT_FADE_THRESHOLD_SIZE' is less than zero.
12175 `GL_INVALID_ENUM' is generated If the value specified for
12176 `GL_POINT_SPRITE_COORD_ORIGIN' is not `GL_LOWER_LEFT' or
12179 If the value for `GL_POINT_SIZE_MIN' is greater than
12180 `GL_POINT_SIZE_MAX', the point size after clamping is undefined, but no
12181 error is generated.")
12183 (define-gl-procedure
12184 ((glPointSize (size GLfloat) -> void))
12185 "Specify the diameter of rasterized points.
12188 Specifies the diameter of rasterized points. The initial value is
12191 `glPointSize' specifies the rasterized diameter of both aliased and
12192 antialiased points. Using a point size other than 1 has different
12193 effects, depending on whether point antialiasing is enabled. To enable
12194 and disable point antialiasing, call `glEnable' and `glDisable' with
12195 argument `GL_POINT_SMOOTH'. Point antialiasing is initially disabled.
12197 The specified point size is multiplied with a distance attenuation
12198 factor and clamped to the specified point size range, and further
12199 clamped to the implementation-dependent point size range to produce the
12200 derived point size using
12202 POINTSIZE=CLAMP\u2062(SIZE×√(1/A+B×D+C×D^2,,,),,)
12204 where D is the eye-coordinate distance from the eye to the vertex, and A
12205 , B , and C are the distance attenuation coefficients (see
12206 `glPointParameter').
12208 If multisampling is disabled, the computed point size is used as the
12211 If multisampling is enabled, the point may be faded by modifying the
12212 point alpha value (see `glSampleCoverage') instead of allowing the point
12213 width to go below a given threshold (see `glPointParameter'). In this
12214 case, the width is further modified in the following manner:
12216 POINTWIDTH={(POINTSIZE), (THRESHOLD)\u2062(POINTSIZE>=THRESHOLD),
12219 The point alpha value is modified by computing:
12221 POINTALPHA={(1), ((POINTSIZE/THRESHOLD,)^2)\u2062(POINTSIZE>=THRESHOLD),
12224 If point antialiasing is disabled, the actual size is determined by
12225 rounding the supplied size to the nearest integer. (If the rounding
12226 results in the value 0, it is as if the point size were 1.) If the
12227 rounded size is odd, then the center point (X , Y ) of the pixel
12228 fragment that represents the point is computed as
12230 (⌊X_W,⌋+.5,⌊Y_W,⌋+.5)
12232 where W subscripts indicate window coordinates. All pixels that lie
12233 within the square grid of the rounded size centered at (X , Y ) make up
12234 the fragment. If the size is even, the center point is
12236 (⌊X_W+.5,⌋,⌊Y_W+.5,⌋)
12238 and the rasterized fragment's centers are the half-integer window
12239 coordinates within the square of the rounded size centered at (X,Y) .
12240 All pixel fragments produced in rasterizing a nonantialiased point are
12241 assigned the same associated data, that of the vertex corresponding to
12244 If antialiasing is enabled, then point rasterization produces a fragment
12245 for each pixel square that intersects the region lying within the circle
12246 having diameter equal to the current point size and centered at the
12247 point's (X_W,Y_W) . The coverage value for each fragment is the window
12248 coordinate area of the intersection of the circular region with the
12249 corresponding pixel square. This value is saved and used in the final
12250 rasterization step. The data associated with each fragment is the data
12251 associated with the point being rasterized.
12253 Not all sizes are supported when point antialiasing is enabled. If an
12254 unsupported size is requested, the nearest supported size is used. Only
12255 size 1 is guaranteed to be supported; others depend on the
12256 implementation. To query the range of supported sizes and the size
12257 difference between supported sizes within the range, call `glGet' with
12258 arguments `GL_SMOOTH_POINT_SIZE_RANGE' and
12259 `GL_SMOOTH_POINT_SIZE_GRANULARITY'. For aliased points, query the
12260 supported ranges and granularity with `glGet' with arguments
12261 `GL_ALIASED_POINT_SIZE_RANGE'.
12263 `GL_INVALID_VALUE' is generated if SIZE is less than or equal to 0.
12265 `GL_INVALID_OPERATION' is generated if `glPointSize' is executed between
12266 the execution of `glBegin' and the corresponding execution of `glEnd'.")
12268 (define-gl-procedure
12274 "Select a polygon rasterization mode.
12277 Specifies the polygons that MODE applies to. Must be `GL_FRONT' for
12278 front-facing polygons, `GL_BACK' for back-facing polygons, or
12279 `GL_FRONT_AND_BACK' for front- and back-facing polygons.
12282 Specifies how polygons will be rasterized. Accepted values are
12283 `GL_POINT', `GL_LINE', and `GL_FILL'. The initial value is
12284 `GL_FILL' for both front- and back-facing polygons.
12286 `glPolygonMode' controls the interpretation of polygons for
12287 rasterization. FACE describes which polygons MODE applies to:
12288 front-facing polygons (`GL_FRONT'), back-facing polygons (`GL_BACK'), or
12289 both (`GL_FRONT_AND_BACK'). The polygon mode affects only the final
12290 rasterization of polygons. In particular, a polygon's vertices are lit
12291 and the polygon is clipped and possibly culled before these modes are
12294 Three modes are defined and can be specified in MODE:
12297 Polygon vertices that are marked as the start of a boundary edge
12298 are drawn as points. Point attributes such as `GL_POINT_SIZE' and
12299 `GL_POINT_SMOOTH' control the rasterization of the points. Polygon
12300 rasterization attributes other than `GL_POLYGON_MODE' have no
12304 Boundary edges of the polygon are drawn as line segments. They are
12305 treated as connected line segments for line stippling; the line
12306 stipple counter and pattern are not reset between segments (see
12307 `glLineStipple'). Line attributes such as `GL_LINE_WIDTH' and
12308 `GL_LINE_SMOOTH' control the rasterization of the lines. Polygon
12309 rasterization attributes other than `GL_POLYGON_MODE' have no
12313 The interior of the polygon is filled. Polygon attributes such as
12314 `GL_POLYGON_STIPPLE' and `GL_POLYGON_SMOOTH' control the
12315 rasterization of the polygon.
12317 `GL_INVALID_ENUM' is generated if either FACE or MODE is not an accepted
12320 `GL_INVALID_OPERATION' is generated if `glPolygonMode' is executed
12321 between the execution of `glBegin' and the corresponding execution of
12324 (define-gl-procedure
12330 "Set the scale and units used to calculate depth values.
12333 Specifies a scale factor that is used to create a variable depth
12334 offset for each polygon. The initial value is 0.
12337 Is multiplied by an implementation-specific value to create a
12338 constant depth offset. The initial value is 0.
12340 When `GL_POLYGON_OFFSET_FILL', `GL_POLYGON_OFFSET_LINE', or
12341 `GL_POLYGON_OFFSET_POINT' is enabled, each fragment's DEPTH value will
12342 be offset after it is interpolated from the DEPTH values of the
12343 appropriate vertices. The value of the offset is FACTOR×DZ+R×UNITS ,
12344 where DZ is a measurement of the change in depth relative to the screen
12345 area of the polygon, and R is the smallest value that is guaranteed to
12346 produce a resolvable offset for a given implementation. The offset is
12347 added before the depth test is performed and before the value is written
12348 into the depth buffer.
12350 `glPolygonOffset' is useful for rendering hidden-line images, for
12351 applying decals to surfaces, and for rendering solids with highlighted
12354 `GL_INVALID_OPERATION' is generated if `glPolygonOffset' is executed
12355 between the execution of `glBegin' and the corresponding execution of
12358 (define-gl-procedure
12359 ((glPolygonStipple (pattern *) -> void))
12360 "Set the polygon stippling pattern.
12363 Specifies a pointer to a 32×32 stipple pattern that will be
12364 unpacked from memory in the same way that `glDrawPixels' unpacks
12367 Polygon stippling, like line stippling (see `glLineStipple'), masks out
12368 certain fragments produced by rasterization, creating a pattern.
12369 Stippling is independent of polygon antialiasing.
12371 PATTERN is a pointer to a 32×32 stipple pattern that is stored in memory
12372 just like the pixel data supplied to a `glDrawPixels' call with height
12373 and WIDTH both equal to 32, a pixel format of `GL_COLOR_INDEX', and data
12374 type of `GL_BITMAP'. That is, the stipple pattern is represented as a
12375 32×32 array of 1-bit color indices packed in unsigned bytes.
12376 `glPixelStore' parameters like `GL_UNPACK_SWAP_BYTES' and
12377 `GL_UNPACK_LSB_FIRST' affect the assembling of the bits into a stipple
12378 pattern. Pixel transfer operations (shift, offset, pixel map) are not
12379 applied to the stipple image, however.
12381 If a non-zero named buffer object is bound to the
12382 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a stipple
12383 pattern is specified, PATTERN is treated as a byte offset into the
12384 buffer object's data store.
12386 To enable and disable polygon stippling, call `glEnable' and `glDisable'
12387 with argument `GL_POLYGON_STIPPLE'. Polygon stippling is initially
12388 disabled. If it's enabled, a rasterized polygon fragment with window
12389 coordinates X_W and Y_W is sent to the next stage of the GL if and only
12390 if the (X_W%32 )th bit in the (Y_W%32 )th row of the stipple pattern is
12391 1 (one). When polygon stippling is disabled, it is as if the stipple
12392 pattern consists of all 1's.
12394 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
12395 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
12396 data store is currently mapped.
12398 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
12399 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
12400 unpacked from the buffer object such that the memory reads required
12401 would exceed the data store size.
12403 `GL_INVALID_OPERATION' is generated if `glPolygonStipple' is executed
12404 between the execution of `glBegin' and the corresponding execution of
12407 (define-gl-procedure
12408 ((glPrioritizeTextures
12414 "Set texture residence priority.
12417 Specifies the number of textures to be prioritized.
12420 Specifies an array containing the names of the textures to be
12424 Specifies an array containing the texture priorities. A priority
12425 given in an element of PRIORITIES applies to the texture named by
12426 the corresponding element of TEXTURES.
12428 `glPrioritizeTextures' assigns the N texture priorities given in
12429 PRIORITIES to the N textures named in TEXTURES.
12431 The GL establishes a ``working set'' of textures that are resident in
12432 texture memory. These textures may be bound to a texture target much
12433 more efficiently than textures that are not resident. By specifying a
12434 priority for each texture, `glPrioritizeTextures' allows applications to
12435 guide the GL implementation in determining which textures should be
12438 The priorities given in PRIORITIES are clamped to the range [0,1] before
12439 they are assigned. 0 indicates the lowest priority; textures with
12440 priority 0 are least likely to be resident. 1 indicates the highest
12441 priority; textures with priority 1 are most likely to be resident.
12442 However, textures are not guaranteed to be resident until they are used.
12444 `glPrioritizeTextures' silently ignores attempts to prioritize texture 0
12445 or any texture name that does not correspond to an existing texture.
12447 `glPrioritizeTextures' does not require that any of the textures named
12448 by TEXTURES be bound to a texture target. `glTexParameter' may also be
12449 used to set a texture's priority, but only if the texture is currently
12450 bound. This is the only way to set the priority of a default texture.
12452 `GL_INVALID_VALUE' is generated if N is negative.
12454 `GL_INVALID_OPERATION' is generated if `glPrioritizeTextures' is
12455 executed between the execution of `glBegin' and the corresponding
12456 execution of `glEnd'.")
12458 (define-gl-procedure
12459 ((glPushAttrib (mask GLbitfield) -> void)
12460 (glPopAttrib -> void))
12461 "Push and pop the server attribute stack.
12464 Specifies a mask that indicates which attributes to save. Values
12465 for MASK are listed below.
12467 `glPushAttrib' takes one argument, a mask that indicates which groups of
12468 state variables to save on the attribute stack. Symbolic constants are
12469 used to set bits in the mask. MASK is typically constructed by
12470 specifying the bitwise-or of several of these constants together. The
12471 special mask `GL_ALL_ATTRIB_BITS' can be used to save all stackable
12474 The symbolic mask constants and their associated GL state are as follows
12475 (the second column lists which attributes are saved):
12479 `GL_ACCUM_BUFFER_BIT'
12480 Accumulation buffer clear value
12482 `GL_COLOR_BUFFER_BIT'
12483 `GL_ALPHA_TEST' enable bit
12486 Alpha test function and reference value
12489 `GL_BLEND' enable bit
12492 Blending source and destination functions
12495 Constant blend color
12501 `GL_DITHER' enable bit
12504 `GL_DRAW_BUFFER' setting
12507 `GL_COLOR_LOGIC_OP' enable bit
12510 `GL_INDEX_LOGIC_OP' enable bit
12516 Color mode and index mode clear values
12519 Color mode and index mode writemasks
12525 Current color index
12528 Current normal vector
12531 Current texture coordinates
12534 Current raster position
12537 `GL_CURRENT_RASTER_POSITION_VALID' flag
12540 RGBA color associated with current raster position
12543 Color index associated with current raster position
12546 Texture coordinates associated with current raster position
12549 `GL_EDGE_FLAG' flag
12551 `GL_DEPTH_BUFFER_BIT'
12552 `GL_DEPTH_TEST' enable bit
12555 Depth buffer test function
12558 Depth buffer clear value
12561 `GL_DEPTH_WRITEMASK' enable bit
12564 `GL_ALPHA_TEST' flag
12567 `GL_AUTO_NORMAL' flag
12573 Enable bits for the user-definable clipping planes
12576 `GL_COLOR_MATERIAL'
12579 `GL_CULL_FACE' flag
12582 `GL_DEPTH_TEST' flag
12591 `GL_LIGHT'I where `0' <= I < `GL_MAX_LIGHTS'
12597 `GL_LINE_SMOOTH' flag
12600 `GL_LINE_STIPPLE' flag
12603 `GL_COLOR_LOGIC_OP' flag
12606 `GL_INDEX_LOGIC_OP' flag
12609 `GL_MAP1_'X where X is a map type
12612 `GL_MAP2_'X where X is a map type
12615 `GL_MULTISAMPLE' flag
12618 `GL_NORMALIZE' flag
12621 `GL_POINT_SMOOTH' flag
12624 `GL_POLYGON_OFFSET_LINE' flag
12627 `GL_POLYGON_OFFSET_FILL' flag
12630 `GL_POLYGON_OFFSET_POINT' flag
12633 `GL_POLYGON_SMOOTH' flag
12636 `GL_POLYGON_STIPPLE' flag
12639 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
12642 `GL_SAMPLE_ALPHA_TO_ONE' flag
12645 `GL_SAMPLE_COVERAGE' flag
12648 `GL_SCISSOR_TEST' flag
12651 `GL_STENCIL_TEST' flag
12654 `GL_TEXTURE_1D' flag
12657 `GL_TEXTURE_2D' flag
12660 `GL_TEXTURE_3D' flag
12663 Flags `GL_TEXTURE_GEN_'X where X is S, T, R, or Q
12666 `GL_MAP1_'X enable bits, where X is a map type
12669 `GL_MAP2_'X enable bits, where X is a map type
12672 1D grid endpoints and divisions
12675 2D grid endpoints and divisions
12678 `GL_AUTO_NORMAL' enable bit
12681 `GL_FOG' enable bit
12699 `GL_FOG_MODE' value
12702 `GL_PERSPECTIVE_CORRECTION_HINT' setting
12705 `GL_POINT_SMOOTH_HINT' setting
12708 `GL_LINE_SMOOTH_HINT' setting
12711 `GL_POLYGON_SMOOTH_HINT' setting
12714 `GL_FOG_HINT' setting
12717 `GL_GENERATE_MIPMAP_HINT' setting
12720 `GL_TEXTURE_COMPRESSION_HINT' setting
12723 `GL_COLOR_MATERIAL' enable bit
12726 `GL_COLOR_MATERIAL_FACE' value
12729 Color material parameters that are tracking the current color
12732 Ambient scene color
12735 `GL_LIGHT_MODEL_LOCAL_VIEWER' value
12738 `GL_LIGHT_MODEL_TWO_SIDE' setting
12741 `GL_LIGHTING' enable bit
12744 Enable bit for each light
12747 Ambient, diffuse, and specular intensity for each light
12750 Direction, position, exponent, and cutoff angle for each light
12753 Constant, linear, and quadratic attenuation factors for each light
12756 Ambient, diffuse, specular, and emissive color for each material
12759 Ambient, diffuse, and specular color indices for each material
12762 Specular exponent for each material
12765 `GL_SHADE_MODEL' setting
12768 `GL_LINE_SMOOTH' flag
12771 `GL_LINE_STIPPLE' enable bit
12774 Line stipple pattern and repeat counter
12780 `GL_LIST_BASE' setting
12782 `GL_MULTISAMPLE_BIT'
12783 `GL_MULTISAMPLE' flag
12786 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
12789 `GL_SAMPLE_ALPHA_TO_ONE' flag
12792 `GL_SAMPLE_COVERAGE' flag
12795 `GL_SAMPLE_COVERAGE_VALUE' value
12798 `GL_SAMPLE_COVERAGE_INVERT' value
12800 `GL_PIXEL_MODE_BIT'
12801 `GL_RED_BIAS' and `GL_RED_SCALE' settings
12804 `GL_GREEN_BIAS' and `GL_GREEN_SCALE' values
12807 `GL_BLUE_BIAS' and `GL_BLUE_SCALE'
12810 `GL_ALPHA_BIAS' and `GL_ALPHA_SCALE'
12813 `GL_DEPTH_BIAS' and `GL_DEPTH_SCALE'
12816 `GL_INDEX_OFFSET' and `GL_INDEX_SHIFT' values
12819 `GL_MAP_COLOR' and `GL_MAP_STENCIL' flags
12822 `GL_ZOOM_X' and `GL_ZOOM_Y' factors
12825 `GL_READ_BUFFER' setting
12828 `GL_POINT_SMOOTH' flag
12834 `GL_CULL_FACE' enable bit
12837 `GL_CULL_FACE_MODE' value
12840 `GL_FRONT_FACE' indicator
12843 `GL_POLYGON_MODE' setting
12846 `GL_POLYGON_SMOOTH' flag
12849 `GL_POLYGON_STIPPLE' enable bit
12852 `GL_POLYGON_OFFSET_FILL' flag
12855 `GL_POLYGON_OFFSET_LINE' flag
12858 `GL_POLYGON_OFFSET_POINT' flag
12861 `GL_POLYGON_OFFSET_FACTOR'
12864 `GL_POLYGON_OFFSET_UNITS'
12866 `GL_POLYGON_STIPPLE_BIT'
12867 Polygon stipple image
12870 `GL_SCISSOR_TEST' flag
12875 `GL_STENCIL_BUFFER_BIT'
12876 `GL_STENCIL_TEST' enable bit
12879 Stencil function and reference value
12885 Stencil fail, pass, and depth buffer pass actions
12888 Stencil buffer clear value
12891 Stencil buffer writemask
12894 Enable bits for the four texture coordinates
12897 Border color for each texture image
12900 Minification function for each texture image
12903 Magnification function for each texture image
12906 Texture coordinates and wrap mode for each texture image
12909 Color and mode for each texture environment
12912 Enable bits `GL_TEXTURE_GEN_'X, X is S, T, R, and Q
12915 `GL_TEXTURE_GEN_MODE' setting for S, T, R, and Q
12918 `glTexGen' plane equations for S, T, R, and Q
12921 Current texture bindings (for example, `GL_TEXTURE_BINDING_2D')
12924 Coefficients of the six clipping planes
12927 Enable bits for the user-definable clipping planes
12930 `GL_MATRIX_MODE' value
12933 `GL_NORMALIZE' flag
12936 `GL_RESCALE_NORMAL' flag
12939 Depth range (near and far)
12942 Viewport origin and extent
12944 `glPopAttrib' restores the values of the state variables saved with the
12945 last `glPushAttrib' command. Those not saved are left unchanged.
12947 It is an error to push attributes onto a full stack or to pop attributes
12948 off an empty stack. In either case, the error flag is set and no other
12949 change is made to GL state.
12951 Initially, the attribute stack is empty.
12953 `GL_STACK_OVERFLOW' is generated if `glPushAttrib' is called while the
12954 attribute stack is full.
12956 `GL_STACK_UNDERFLOW' is generated if `glPopAttrib' is called while the
12957 attribute stack is empty.
12959 `GL_INVALID_OPERATION' is generated if `glPushAttrib' or `glPopAttrib'
12960 is executed between the execution of `glBegin' and the corresponding
12961 execution of `glEnd'.")
12963 (define-gl-procedure
12964 ((glPushClientAttrib (mask GLbitfield) -> void)
12965 (glPopClientAttrib -> void))
12966 "Push and pop the client attribute stack.
12969 Specifies a mask that indicates which attributes to save. Values
12970 for MASK are listed below.
12972 `glPushClientAttrib' takes one argument, a mask that indicates which
12973 groups of client-state variables to save on the client attribute stack.
12974 Symbolic constants are used to set bits in the mask. MASK is typically
12975 constructed by specifying the bitwise-or of several of these constants
12976 together. The special mask `GL_CLIENT_ALL_ATTRIB_BITS' can be used to
12977 save all stackable client state.
12979 The symbolic mask constants and their associated GL client state are as
12980 follows (the second column lists which attributes are saved):
12982 `GL_CLIENT_PIXEL_STORE_BIT' Pixel storage modes
12983 `GL_CLIENT_VERTEX_ARRAY_BIT' Vertex arrays (and enables)
12985 `glPopClientAttrib' restores the values of the client-state variables
12986 saved with the last `glPushClientAttrib'. Those not saved are left
12989 It is an error to push attributes onto a full client attribute stack or
12990 to pop attributes off an empty stack. In either case, the error flag is
12991 set, and no other change is made to GL state.
12993 Initially, the client attribute stack is empty.
12995 `GL_STACK_OVERFLOW' is generated if `glPushClientAttrib' is called while
12996 the attribute stack is full.
12998 `GL_STACK_UNDERFLOW' is generated if `glPopClientAttrib' is called while
12999 the attribute stack is empty.")
13001 (define-gl-procedure
13002 ((glPushMatrix -> void) (glPopMatrix -> void))
13003 "Push and pop the current matrix stack.
13005 There is a stack of matrices for each of the matrix modes. In
13006 `GL_MODELVIEW' mode, the stack depth is at least 32. In the other modes,
13007 `GL_COLOR', `GL_PROJECTION', and `GL_TEXTURE', the depth is at least 2.
13008 The current matrix in any mode is the matrix on the top of the stack for
13011 `glPushMatrix' pushes the current matrix stack down by one, duplicating
13012 the current matrix. That is, after a `glPushMatrix' call, the matrix on
13013 top of the stack is identical to the one below it.
13015 `glPopMatrix' pops the current matrix stack, replacing the current
13016 matrix with the one below it on the stack.
13018 Initially, each of the stacks contains one matrix, an identity matrix.
13020 It is an error to push a full matrix stack or to pop a matrix stack that
13021 contains only a single matrix. In either case, the error flag is set and
13022 no other change is made to GL state.
13024 `GL_STACK_OVERFLOW' is generated if `glPushMatrix' is called while the
13025 current matrix stack is full.
13027 `GL_STACK_UNDERFLOW' is generated if `glPopMatrix' is called while the
13028 current matrix stack contains only a single matrix.
13030 `GL_INVALID_OPERATION' is generated if `glPushMatrix' or `glPopMatrix'
13031 is executed between the execution of `glBegin' and the corresponding
13032 execution of `glEnd'.")
13034 (define-gl-procedure
13035 ((glPushName (name GLuint) -> void)
13036 (glPopName -> void))
13037 "Push and pop the name stack.
13040 Specifies a name that will be pushed onto the name stack.
13042 The name stack is used during selection mode to allow sets of rendering
13043 commands to be uniquely identified. It consists of an ordered set of
13044 unsigned integers and is initially empty.
13046 `glPushName' causes NAME to be pushed onto the name stack. `glPopName'
13047 pops one name off the top of the stack.
13049 The maximum name stack depth is implementation-dependent; call
13050 `GL_MAX_NAME_STACK_DEPTH' to find out the value for a particular
13051 implementation. It is an error to push a name onto a full stack or to
13052 pop a name off an empty stack. It is also an error to manipulate the
13053 name stack between the execution of `glBegin' and the corresponding
13054 execution of `glEnd'. In any of these cases, the error flag is set and
13055 no other change is made to GL state.
13057 The name stack is always empty while the render mode is not `GL_SELECT'.
13058 Calls to `glPushName' or `glPopName' while the render mode is not
13059 `GL_SELECT' are ignored.
13061 `GL_STACK_OVERFLOW' is generated if `glPushName' is called while the
13062 name stack is full.
13064 `GL_STACK_UNDERFLOW' is generated if `glPopName' is called while the
13065 name stack is empty.
13067 `GL_INVALID_OPERATION' is generated if `glPushName' or `glPopName' is
13068 executed between a call to `glBegin' and the corresponding call to
13071 (define-gl-procedure
13072 ((glRasterPos2i (x GLint) (y GLint) -> void)
13073 (glRasterPos2d (x GLdouble) (y GLdouble) -> void)
13100 "Specify the raster position for pixel operations.
13109 Specify the X , Y , Z , and W object coordinates (if present) for
13110 the raster position.
13112 The GL maintains a 3D position in window coordinates. This position,
13113 called the raster position, is used to position pixel and bitmap write
13114 operations. It is maintained with subpixel accuracy. See `glBitmap',
13115 `glDrawPixels', and `glCopyPixels'.
13117 The current raster position consists of three window coordinates (X , Y
13118 , Z ), a clip coordinate value (W ), an eye coordinate distance, a valid
13119 bit, and associated color data and texture coordinates. The W coordinate
13120 is a clip coordinate, because W is not projected to window coordinates.
13121 `glRasterPos4' specifies object coordinates X , Y , Z , and W
13122 explicitly. `glRasterPos3' specifies object coordinate X , Y , and Z
13123 explicitly, while W is implicitly set to 1. `glRasterPos2' uses the
13124 argument values for X and Y while implicitly setting Z and W to 0 and 1.
13126 The object coordinates presented by `glRasterPos' are treated just like
13127 those of a `glVertex' command: They are transformed by the current
13128 modelview and projection matrices and passed to the clipping stage. If
13129 the vertex is not culled, then it is projected and scaled to window
13130 coordinates, which become the new current raster position, and the
13131 `GL_CURRENT_RASTER_POSITION_VALID' flag is set. If the vertex IS culled,
13132 then the valid bit is cleared and the current raster position and
13133 associated color and texture coordinates are undefined.
13135 The current raster position also includes some associated color data and
13136 texture coordinates. If lighting is enabled, then
13137 `GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
13138 (in color index mode) is set to the color produced by the lighting
13139 calculation (see `glLight', `glLightModel', and `glShadeModel'). If
13140 lighting is disabled, current color (in RGBA mode, state variable
13141 `GL_CURRENT_COLOR') or color index (in color index mode, state variable
13142 `GL_CURRENT_INDEX') is used to update the current raster color.
13143 `GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
13145 Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
13146 `GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
13147 generation functions (see `glTexGen'). Finally, the distance from the
13148 origin of the eye coordinate system to the vertex as transformed by only
13149 the modelview matrix replaces `GL_CURRENT_RASTER_DISTANCE'.
13151 Initially, the current raster position is (0, 0, 0, 1), the current
13152 raster distance is 0, the valid bit is set, the associated RGBA color is
13153 (1, 1, 1, 1), the associated color index is 1, and the associated
13154 texture coordinates are (0, 0, 0, 1). In RGBA mode,
13155 `GL_CURRENT_RASTER_INDEX' is always 1; in color index mode, the current
13156 raster RGBA color always maintains its initial value.
13158 `GL_INVALID_OPERATION' is generated if `glRasterPos' is executed between
13159 the execution of `glBegin' and the corresponding execution of `glEnd'.")
13161 (define-gl-procedure
13162 ((glReadBuffer (mode GLenum) -> void))
13163 "Select a color buffer source for pixels.
13166 Specifies a color buffer. Accepted values are `GL_FRONT_LEFT',
13167 `GL_FRONT_RIGHT', `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT',
13168 `GL_BACK', `GL_LEFT', `GL_RIGHT', and `GL_AUX'I, where I is between
13169 0 and the value of `GL_AUX_BUFFERS' minus 1.
13171 `glReadBuffer' specifies a color buffer as the source for subsequent
13172 `glReadPixels', `glCopyTexImage1D', `glCopyTexImage2D',
13173 `glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D', and
13174 `glCopyPixels' commands. MODE accepts one of twelve or more predefined
13175 values. (`GL_AUX0' through `GL_AUX3' are always defined.) In a fully
13176 configured system, `GL_FRONT', `GL_LEFT', and `GL_FRONT_LEFT' all name
13177 the front left buffer, `GL_FRONT_RIGHT' and `GL_RIGHT' name the front
13178 right buffer, and `GL_BACK_LEFT' and `GL_BACK' name the back left
13181 Nonstereo double-buffered configurations have only a front left and a
13182 back left buffer. Single-buffered configurations have a front left and a
13183 front right buffer if stereo, and only a front left buffer if nonstereo.
13184 It is an error to specify a nonexistent buffer to `glReadBuffer'.
13186 MODE is initially `GL_FRONT' in single-buffered configurations and
13187 `GL_BACK' in double-buffered configurations.
13189 `GL_INVALID_ENUM' is generated if MODE is not one of the twelve (or
13190 more) accepted values.
13192 `GL_INVALID_OPERATION' is generated if MODE specifies a buffer that does
13195 `GL_INVALID_OPERATION' is generated if `glReadBuffer' is executed
13196 between the execution of `glBegin' and the corresponding execution of
13199 (define-gl-procedure
13210 "Read a block of pixels from the frame buffer.
13215 Specify the window coordinates of the first pixel that is read from
13216 the frame buffer. This location is the lower left corner of a
13217 rectangular block of pixels.
13222 Specify the dimensions of the pixel rectangle. WIDTH and HEIGHT of
13223 one correspond to a single pixel.
13226 Specifies the format of the pixel data. The following symbolic
13227 values are accepted: `GL_COLOR_INDEX', `GL_STENCIL_INDEX',
13228 `GL_DEPTH_COMPONENT', `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA',
13229 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
13230 `GL_LUMINANCE_ALPHA'.
13233 Specifies the data type of the pixel data. Must be one of
13234 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
13235 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
13236 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
13237 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
13238 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
13239 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
13240 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
13241 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV'.
13244 Returns the pixel data.
13246 `glReadPixels' returns pixel data from the frame buffer, starting with
13247 the pixel whose lower left corner is at location (X, Y), into client
13248 memory starting at location DATA. Several parameters control the
13249 processing of the pixel data before it is placed into client memory.
13250 These parameters are set with three commands: `glPixelStore',
13251 `glPixelTransfer', and `glPixelMap'. This reference page describes the
13252 effects on `glReadPixels' of most, but not all of the parameters
13253 specified by these three commands.
13255 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
13256 target (see `glBindBuffer') while a block of pixels is requested, DATA
13257 is treated as a byte offset into the buffer object's data store rather
13258 than a pointer to client memory.
13260 When the `ARB_imaging' extension is supported, the pixel data may be
13261 processed by additional operations including color table lookup, color
13262 matrix transformations, convolutions, histograms, and minimum and
13263 maximum pixel value computations.
13265 `glReadPixels' returns values from each pixel with lower left corner at
13266 (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said to be the
13267 I th pixel in the J th row. Pixels are returned in row order from the
13268 lowest to the highest row, left to right in each row.
13270 FORMAT specifies the format for the returned pixel values; accepted
13274 Color indices are read from the color buffer selected by
13275 `glReadBuffer'. Each index is converted to fixed point, shifted
13276 left or right depending on the value and sign of `GL_INDEX_SHIFT',
13277 and added to `GL_INDEX_OFFSET'. If `GL_MAP_COLOR' is `GL_TRUE',
13278 indices are replaced by their mappings in the table
13279 `GL_PIXEL_MAP_I_TO_I'.
13282 Stencil values are read from the stencil buffer. Each index is
13283 converted to fixed point, shifted left or right depending on the
13284 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'.
13285 If `GL_MAP_STENCIL' is `GL_TRUE', indices are replaced by their
13286 mappings in the table `GL_PIXEL_MAP_S_TO_S'.
13288 `GL_DEPTH_COMPONENT'
13289 Depth values are read from the depth buffer. Each component is
13290 converted to floating point such that the minimum depth value maps
13291 to 0 and the maximum value maps to 1. Each component is then
13292 multiplied by `GL_DEPTH_SCALE', added to `GL_DEPTH_BIAS', and
13293 finally clamped to the range [0,1] .
13304 `GL_LUMINANCE_ALPHA'
13305 Processing differs depending on whether color buffers store color
13306 indices or RGBA color components. If color indices are stored, they
13307 are read from the color buffer selected by `glReadBuffer'. Each
13308 index is converted to fixed point, shifted left or right depending
13309 on the value and sign of `GL_INDEX_SHIFT', and added to
13310 `GL_INDEX_OFFSET'. Indices are then replaced by the red, green,
13311 blue, and alpha values obtained by indexing the tables
13312 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
13313 `GL_PIXEL_MAP_I_TO_B', and `GL_PIXEL_MAP_I_TO_A'. Each table must
13314 be of size 2^N , but N may be different for different tables.
13315 Before an index is used to look up a value in a table of size 2^N ,
13316 it must be masked against 2^N-1 .
13318 If RGBA color components are stored in the color buffers, they are
13319 read from the color buffer selected by `glReadBuffer'. Each color
13320 component is converted to floating point such that zero intensity
13321 maps to 0.0 and full intensity maps to 1.0. Each component is then
13322 multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where C is
13323 RED, GREEN, BLUE, or ALPHA. Finally, if `GL_MAP_COLOR' is
13324 `GL_TRUE', each component is clamped to the range [0,1] , scaled to
13325 the size of its corresponding table, and is then replaced by its
13326 mapping in the table `GL_PIXEL_MAP_c_TO_c', where C is R, G, B, or
13329 Unneeded data is then discarded. For example, `GL_RED' discards the
13330 green, blue, and alpha components, while `GL_RGB' discards only the
13331 alpha component. `GL_LUMINANCE' computes a single-component value
13332 as the sum of the red, green, and blue components, and
13333 `GL_LUMINANCE_ALPHA' does the same, while keeping alpha as a second
13334 value. The final values are clamped to the range [0,1] .
13336 The shift, scale, bias, and lookup factors just described are all
13337 specified by `glPixelTransfer'. The lookup table contents themselves are
13338 specified by `glPixelMap'.
13340 Finally, the indices or components are converted to the proper format,
13341 as specified by TYPE. If FORMAT is `GL_COLOR_INDEX' or
13342 `GL_STENCIL_INDEX' and TYPE is not `GL_FLOAT', each index is masked with
13343 the mask value given in the following table. If TYPE is `GL_FLOAT', then
13344 each integer index is converted to single-precision floating-point
13347 If FORMAT is `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
13348 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'
13349 and TYPE is not `GL_FLOAT', each component is multiplied by the
13350 multiplier shown in the following table. If type is `GL_FLOAT', then
13351 each component is passed as is (or converted to the client's
13352 single-precision floating-point format if it is different from the one
13358 *Index Mask*, *Component Conversion*
13361 2^8-1 , (2^8-1,)\u2062C
13364 2^7-1 , (2^8-1,)\u2062C-1,/2
13369 `GL_UNSIGNED_SHORT'
13370 2^16-1 , (2^16-1,)\u2062C
13373 2^15-1 , (2^16-1,)\u2062C-1,/2
13376 2^32-1 , (2^32-1,)\u2062C
13379 2^31-1 , (2^32-1,)\u2062C-1,/2
13384 Return values are placed in memory as follows. If FORMAT is
13385 `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT', `GL_RED',
13386 `GL_GREEN', `GL_BLUE', `GL_ALPHA', or `GL_LUMINANCE', a single value is
13387 returned and the data for the I th pixel in the J th row is placed in
13388 location (J,)\u2062WIDTH+I . `GL_RGB' and `GL_BGR' return three values,
13389 `GL_RGBA' and `GL_BGRA' return four values, and `GL_LUMINANCE_ALPHA'
13390 returns two values for each pixel, with all values corresponding to a
13391 single pixel occupying contiguous space in DATA. Storage parameters set
13392 by `glPixelStore', such as `GL_PACK_LSB_FIRST' and `GL_PACK_SWAP_BYTES',
13393 affect the way that data is written into memory. See `glPixelStore' for
13396 `GL_INVALID_ENUM' is generated if FORMAT or TYPE is not an accepted
13399 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
13400 `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
13402 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
13404 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_COLOR_INDEX' and
13405 the color buffers store RGBA color components.
13407 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
13408 there is no stencil buffer.
13410 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
13411 and there is no depth buffer.
13413 `GL_INVALID_OPERATION' is generated if TYPE is one of
13414 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
13415 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
13418 `GL_INVALID_OPERATION' is generated if TYPE is one of
13419 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
13420 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
13421 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
13422 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
13423 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
13425 The formats `GL_BGR', and `GL_BGRA' and types `GL_UNSIGNED_BYTE_3_3_2',
13426 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
13427 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
13428 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
13429 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
13430 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
13431 `GL_UNSIGNED_INT_2_10_10_10_REV' are available only if the GL version is
13434 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13435 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
13436 store is currently mapped.
13438 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13439 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
13440 to the buffer object such that the memory writes required would exceed
13441 the data store size.
13443 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13444 bound to the `GL_PIXEL_PACK_BUFFER' target and DATA is not evenly
13445 divisible into the number of bytes needed to store in memory a datum
13448 `GL_INVALID_OPERATION' is generated if `glReadPixels' is executed
13449 between the execution of `glBegin' and the corresponding execution of
13452 (define-gl-procedure
13472 Specify one vertex of a rectangle.
13477 Specify the opposite vertex of the rectangle.
13479 `glRect' supports efficient specification of rectangles as two corner
13480 points. Each rectangle command takes four arguments, organized either as
13481 two consecutive pairs of (X,Y) coordinates or as two pointers to arrays,
13482 each containing an (X,Y) pair. The resulting rectangle is defined in the
13485 `glRect'(X1, Y1, X2, Y2) is exactly equivalent to the following
13486 sequence: Note that if the second vertex is above and to the right of
13487 the first vertex, the rectangle is constructed with a counterclockwise
13491 glBegin(`GL_POLYGON');
13498 `GL_INVALID_OPERATION' is generated if `glRect' is executed between the
13499 execution of `glBegin' and the corresponding execution of `glEnd'.")
13501 (define-gl-procedure
13502 ((glRenderMode (mode GLenum) -> GLint))
13503 "Set rasterization mode.
13506 Specifies the rasterization mode. Three values are accepted:
13507 `GL_RENDER', `GL_SELECT', and `GL_FEEDBACK'. The initial value is
13510 `glRenderMode' sets the rasterization mode. It takes one argument, MODE,
13511 which can assume one of three predefined values:
13514 Render mode. Primitives are rasterized, producing pixel fragments,
13515 which are written into the frame buffer. This is the normal mode
13516 and also the default mode.
13519 Selection mode. No pixel fragments are produced, and no change to
13520 the frame buffer contents is made. Instead, a record of the names
13521 of primitives that would have been drawn if the render mode had
13522 been `GL_RENDER' is returned in a select buffer, which must be
13523 created (see `glSelectBuffer') before selection mode is entered.
13526 Feedback mode. No pixel fragments are produced, and no change to
13527 the frame buffer contents is made. Instead, the coordinates and
13528 attributes of vertices that would have been drawn if the render
13529 mode had been `GL_RENDER' is returned in a feedback buffer, which
13530 must be created (see `glFeedbackBuffer') before feedback mode is
13533 The return value of `glRenderMode' is determined by the render mode at
13534 the time `glRenderMode' is called, rather than by MODE. The values
13535 returned for the three render modes are as follows:
13541 The number of hit records transferred to the select buffer.
13544 The number of values (not vertices) transferred to the feedback
13547 See the `glSelectBuffer' and `glFeedbackBuffer' reference pages for more
13548 details concerning selection and feedback operation.
13550 `GL_INVALID_ENUM' is generated if MODE is not one of the three accepted
13553 `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
13554 the render mode is `GL_SELECT', or if `glRenderMode' is called with
13555 argument `GL_SELECT' before `glSelectBuffer' is called at least once.
13557 `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
13558 while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
13559 with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
13562 `GL_INVALID_OPERATION' is generated if `glRenderMode' is executed
13563 between the execution of `glBegin' and the corresponding execution of
13566 (define-gl-procedure
13567 ((glResetHistogram (target GLenum) -> void))
13568 "Reset histogram table entries to zero.
13571 Must be `GL_HISTOGRAM'.
13573 `glResetHistogram' resets all the elements of the current histogram
13576 `GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
13578 `GL_INVALID_OPERATION' is generated if `glResetHistogram' is executed
13579 between the execution of `glBegin' and the corresponding execution of
13582 (define-gl-procedure
13583 ((glResetMinmax (target GLenum) -> void))
13584 "Reset minmax table entries to initial values.
13587 Must be `GL_MINMAX'.
13589 `glResetMinmax' resets the elements of the current minmax table to their
13590 initial values: the ``maximum'' element receives the minimum possible
13591 component values, and the ``minimum'' element receives the maximum
13592 possible component values.
13594 `GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
13596 `GL_INVALID_OPERATION' is generated if `glResetMinmax' is executed
13597 between the execution of `glBegin' and the corresponding execution of
13600 (define-gl-procedure
13608 "Multiply the current matrix by a rotation matrix.
13611 Specifies the angle of rotation, in degrees.
13618 Specify the X, Y, and Z coordinates of a vector, respectively.
13620 `glRotate' produces a rotation of ANGLE degrees around the vector (X,YZ)
13621 . The current matrix (see `glMatrixMode') is multiplied by a rotation
13622 matrix with the product replacing the current matrix, as if
13623 `glMultMatrix' were called with the following matrix as its argument:
13625 ((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
13626 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
13627 Z^2\u2061(1-C,)+C 0), (0 0 0 1),)
13631 Where C=COS\u2061(ANGLE,) , S=SIN\u2061(ANGLE,) , and ∥(X,YZ),∥=1 (if not, the GL
13632 will normalize this vector).
13638 If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
13639 objects drawn after `glRotate' is called are rotated. Use `glPushMatrix'
13640 and `glPopMatrix' to save and restore the unrotated coordinate system.
13642 `GL_INVALID_OPERATION' is generated if `glRotate' is executed between
13643 the execution of `glBegin' and the corresponding execution of `glEnd'.")
13645 (define-gl-procedure
13651 "Specify multisample coverage parameters.
13654 Specify a single floating-point sample coverage value. The value is
13655 clamped to the range [0,1] . The initial value is 1.0.
13658 Specify a single boolean value representing if the coverage masks
13659 should be inverted. `GL_TRUE' and `GL_FALSE' are accepted. The
13660 initial value is `GL_FALSE'.
13662 Multisampling samples a pixel multiple times at various
13663 implementation-dependent subpixel locations to generate antialiasing
13664 effects. Multisampling transparently antialiases points, lines,
13665 polygons, bitmaps, and images if it is enabled.
13667 VALUE is used in constructing a temporary mask used in determining which
13668 samples will be used in resolving the final fragment color. This mask is
13669 bitwise-anded with the coverage mask generated from the multisampling
13670 computation. If the INVERT flag is set, the temporary mask is inverted
13671 (all bits flipped) and then the bitwise-and is computed.
13673 If an implementation does not have any multisample buffers available, or
13674 multisampling is disabled, rasterization occurs with only a single
13675 sample computing a pixel's final RGB color.
13677 Provided an implementation supports multisample buffers, and
13678 multisampling is enabled, then a pixel's final color is generated by
13679 combining several samples per pixel. Each sample contains color, depth,
13680 and stencil information, allowing those operations to be performed on
13683 `GL_INVALID_OPERATION' is generated if `glSampleCoverage' is executed
13684 between the execution of `glBegin' and the corresponding execution of
13687 (define-gl-procedure
13694 "Multiply the current matrix by a general scaling matrix.
13701 Specify scale factors along the X, Y, and Z axes, respectively.
13703 `glScale' produces a nonuniform scaling along the X, Y, and Z axes. The
13704 three parameters indicate the desired scale factor along each of the
13707 The current matrix (see `glMatrixMode') is multiplied by this scale
13708 matrix, and the product replaces the current matrix as if `glMultMatrix'
13709 were called with the following matrix as its argument:
13711 ((X 0 0 0), (0 Y 0 0), (0 0 Z 0), (0 0 0 1),)
13713 If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
13714 objects drawn after `glScale' is called are scaled.
13716 Use `glPushMatrix' and `glPopMatrix' to save and restore the unscaled
13719 `GL_INVALID_OPERATION' is generated if `glScale' is executed between the
13720 execution of `glBegin' and the corresponding execution of `glEnd'.")
13722 (define-gl-procedure
13730 "Define the scissor box.
13735 Specify the lower left corner of the scissor box. Initially (0, 0).
13740 Specify the width and height of the scissor box. When a GL context
13741 is first attached to a window, WIDTH and HEIGHT are set to the
13742 dimensions of that window.
13744 `glScissor' defines a rectangle, called the scissor box, in window
13745 coordinates. The first two arguments, X and Y, specify the lower left
13746 corner of the box. WIDTH and HEIGHT specify the width and height of the
13749 To enable and disable the scissor test, call `glEnable' and `glDisable'
13750 with argument `GL_SCISSOR_TEST'. The test is initially disabled. While
13751 the test is enabled, only pixels that lie within the scissor box can be
13752 modified by drawing commands. Window coordinates have integer values at
13753 the shared corners of frame buffer pixels. `glScissor(0,0,1,1)' allows
13754 modification of only the lower left pixel in the window, and
13755 `glScissor(0,0,0,0)' doesn't allow modification of any pixels in the
13758 When the scissor test is disabled, it is as though the scissor box
13759 includes the entire window.
13761 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
13763 `GL_INVALID_OPERATION' is generated if `glScissor' is executed between
13764 the execution of `glBegin' and the corresponding execution of `glEnd'.")
13766 (define-gl-procedure
13767 ((glSecondaryColorPointer
13774 "Define an array of secondary colors.
13777 Specifies the number of components per color. Must be 3.
13780 Specifies the data type of each color component in the array.
13781 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
13782 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
13783 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
13786 Specifies the byte offset between consecutive colors. If STRIDE is
13787 0, the colors are understood to be tightly packed in the array. The
13788 initial value is 0.
13791 Specifies a pointer to the first component of the first color
13792 element in the array. The initial value is 0.
13794 `glSecondaryColorPointer' specifies the location and data format of an
13795 array of color components to use when rendering. SIZE specifies the
13796 number of components per color, and must be 3. TYPE specifies the data
13797 type of each color component, and STRIDE specifies the byte stride from
13798 one color to the next, allowing vertices and attributes to be packed
13799 into a single array or stored in separate arrays.
13801 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
13802 target (see `glBindBuffer') while a secondary color array is specified,
13803 POINTER is treated as a byte offset into the buffer object's data store.
13804 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
13805 secondary color vertex array client-side state
13806 (`GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING').
13808 When a secondary color array is specified, SIZE, TYPE, STRIDE, and
13809 POINTER are saved as client-side state, in addition to the current
13810 vertex array buffer object binding.
13812 To enable and disable the secondary color array, call
13813 `glEnableClientState' and `glDisableClientState' with the argument
13814 `GL_SECONDARY_COLOR_ARRAY'. If enabled, the secondary color array is
13815 used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
13816 `glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
13819 `GL_INVALID_VALUE' is generated if SIZE is not 3.
13821 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
13823 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
13825 (define-gl-procedure
13826 ((glSecondaryColor3i
13832 (glSecondaryColor3d
13838 (glSecondaryColor3ui
13844 "Set the current secondary color.
13851 Specify new red, green, and blue values for the current secondary
13854 The GL stores both a primary four-valued RGBA color and a secondary
13855 four-valued RGBA color (where alpha is always set to 0.0) that is
13856 associated with every vertex.
13858 The secondary color is interpolated and applied to each fragment during
13859 rasterization when `GL_COLOR_SUM' is enabled. When lighting is enabled,
13860 and `GL_SEPARATE_SPECULAR_COLOR' is specified, the value of the
13861 secondary color is assigned the value computed from the specular term of
13862 the lighting computation. Both the primary and secondary current colors
13863 are applied to each fragment, regardless of the state of `GL_COLOR_SUM',
13864 under such conditions. When `GL_SEPARATE_SPECULAR_COLOR' is specified,
13865 the value returned from querying the current secondary color is
13868 `glSecondaryColor3b', `glSecondaryColor3s', and `glSecondaryColor3i'
13869 take three signed byte, short, or long integers as arguments. When *v*
13870 is appended to the name, the color commands can take a pointer to an
13871 array of such values.
13873 Color values are stored in floating-point format, with unspecified
13874 mantissa and exponent sizes. Unsigned integer color components, when
13875 specified, are linearly mapped to floating-point values such that the
13876 largest representable value maps to 1.0 (full intensity), and 0 maps to
13877 0.0 (zero intensity). Signed integer color components, when specified,
13878 are linearly mapped to floating-point values such that the most positive
13879 representable value maps to 1.0, and the most negative representable
13880 value maps to -1.0 . (Note that this mapping does not convert 0
13881 precisely to 0.0). Floating-point values are mapped directly.
13883 Neither floating-point nor signed integer values are clamped to the
13884 range [0,1] before the current color is updated. However, color
13885 components are clamped to this range before they are interpolated or
13886 written into a color buffer.")
13888 (define-gl-procedure
13894 "Establish a buffer for selection mode values.
13897 Specifies the size of BUFFER.
13900 Returns the selection data.
13902 `glSelectBuffer' has two arguments: BUFFER is a pointer to an array of
13903 unsigned integers, and SIZE indicates the size of the array. BUFFER
13904 returns values from the name stack (see `glInitNames', `glLoadName',
13905 `glPushName') when the rendering mode is `GL_SELECT' (see
13906 `glRenderMode'). `glSelectBuffer' must be issued before selection mode
13907 is enabled, and it must not be issued while the rendering mode is
13910 A programmer can use selection to determine which primitives are drawn
13911 into some region of a window. The region is defined by the current
13912 modelview and perspective matrices.
13914 In selection mode, no pixel fragments are produced from rasterization.
13915 Instead, if a primitive or a raster position intersects the clipping
13916 volume defined by the viewing frustum and the user-defined clipping
13917 planes, this primitive causes a selection hit. (With polygons, no hit
13918 occurs if the polygon is culled.) When a change is made to the name
13919 stack, or when `glRenderMode' is called, a hit record is copied to
13920 BUFFER if any hits have occurred since the last such event (name stack
13921 change or `glRenderMode' call). The hit record consists of the number of
13922 names in the name stack at the time of the event, followed by the
13923 minimum and maximum depth values of all vertices that hit since the
13924 previous event, followed by the name stack contents, bottom name first.
13926 Depth values (which are in the range [0,1]) are multiplied by 2^32-1 ,
13927 before being placed in the hit record.
13929 An internal index into BUFFER is reset to 0 whenever selection mode is
13930 entered. Each time a hit record is copied into BUFFER, the index is
13931 incremented to point to the cell just past the end of the block of
13932 names\\(emthat is, to the next available cell If the hit record is larger
13933 than the number of remaining locations in BUFFER, as much data as can
13934 fit is copied, and the overflow flag is set. If the name stack is empty
13935 when a hit record is copied, that record consists of 0 followed by the
13936 minimum and maximum depth values.
13938 To exit selection mode, call `glRenderMode' with an argument other than
13939 `GL_SELECT'. Whenever `glRenderMode' is called while the render mode is
13940 `GL_SELECT', it returns the number of hit records copied to BUFFER,
13941 resets the overflow flag and the selection buffer pointer, and
13942 initializes the name stack to be empty. If the overflow bit was set when
13943 `glRenderMode' was called, a negative hit record count is returned.
13945 `GL_INVALID_VALUE' is generated if SIZE is negative.
13947 `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
13948 the render mode is `GL_SELECT', or if `glRenderMode' is called with
13949 argument `GL_SELECT' before `glSelectBuffer' is called at least once.
13951 `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is executed
13952 between the execution of `glBegin' and the corresponding execution of
13955 (define-gl-procedure
13956 ((glSeparableFilter2D
13958 (internalformat GLenum)
13967 "Define a separable two-dimensional convolution filter.
13970 Must be `GL_SEPARABLE_2D'.
13973 The internal format of the convolution filter kernel. The allowable
13974 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
13975 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
13976 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
13977 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
13978 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
13979 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
13980 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
13981 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
13982 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
13983 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
13984 `GL_RGBA12', or `GL_RGBA16'.
13987 The number of elements in the pixel array referenced by ROW. (This
13988 is the width of the separable filter kernel.)
13991 The number of elements in the pixel array referenced by COLUMN.
13992 (This is the height of the separable filter kernel.)
13995 The format of the pixel data in ROW and COLUMN. The allowable
13996 values are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
13997 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_INTENSITY', `GL_LUMINANCE', and
13998 `GL_LUMINANCE_ALPHA'.
14001 The type of the pixel data in ROW and COLUMN. Symbolic constants
14002 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
14003 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
14004 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
14005 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
14006 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
14007 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
14008 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
14009 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
14013 Pointer to a one-dimensional array of pixel data that is processed
14014 to build the row filter kernel.
14017 Pointer to a one-dimensional array of pixel data that is processed
14018 to build the column filter kernel.
14020 `glSeparableFilter2D' builds a two-dimensional separable convolution
14021 filter kernel from two arrays of pixels.
14023 The pixel arrays specified by (WIDTH, FORMAT, TYPE, ROW) and (HEIGHT,
14024 FORMAT, TYPE, COLUMN) are processed just as if they had been passed to
14025 `glDrawPixels', but processing stops after the final expansion to RGBA
14028 If a non-zero named buffer object is bound to the
14029 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
14030 filter is specified, ROW and COLUMN are treated as byte offsets into the
14031 buffer object's data store.
14033 Next, the R, G, B, and A components of all pixels in both arrays are
14034 scaled by the four separable 2D `GL_CONVOLUTION_FILTER_SCALE' parameters
14035 and biased by the four separable 2D `GL_CONVOLUTION_FILTER_BIAS'
14036 parameters. (The scale and bias parameters are set by
14037 `glConvolutionParameter' using the `GL_SEPARABLE_2D' target and the
14038 names `GL_CONVOLUTION_FILTER_SCALE' and `GL_CONVOLUTION_FILTER_BIAS'.
14039 The parameters themselves are vectors of four values that are applied to
14040 red, green, blue, and alpha, in that order.) The R, G, B, and A values
14041 are not clamped to [0,1] at any time during this process.
14043 Each pixel is then converted to the internal format specified by
14044 INTERNALFORMAT. This conversion simply maps the component values of the
14045 pixel (R, G, B, and A) to the values included in the internal format
14046 (red, green, blue, alpha, luminance, and intensity). The mapping is as
14050 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
14055 `GL_LUMINANCE_ALPHA'
14067 The red, green, blue, alpha, luminance, and/or intensity components of
14068 the resulting pixels are stored in floating-point rather than integer
14069 format. They form two one-dimensional filter kernel images. The row
14070 image is indexed by coordinate I starting at zero and increasing from
14071 left to right. Each location in the row image is derived from element I
14072 of ROW. The column image is indexed by coordinate J starting at zero and
14073 increasing from bottom to top. Each location in the column image is
14074 derived from element J of COLUMN.
14076 Note that after a convolution is performed, the resulting color
14077 components are also scaled by their corresponding
14078 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
14079 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
14080 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
14081 set by `glPixelTransfer'.
14083 `GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
14085 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
14088 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
14091 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
14094 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
14095 than the maximum supported value. This value may be queried with
14096 `glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
14097 `GL_MAX_CONVOLUTION_WIDTH'.
14099 `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
14100 than the maximum supported value. This value may be queried with
14101 `glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
14102 `GL_MAX_CONVOLUTION_HEIGHT'.
14104 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
14105 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
14106 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
14109 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
14110 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
14111 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
14112 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
14113 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
14114 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
14116 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14117 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
14118 data store is currently mapped.
14120 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14121 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
14122 unpacked from the buffer object such that the memory reads required
14123 would exceed the data store size.
14125 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14126 bound to the `GL_PIXEL_UNPACK_BUFFER' target and ROW or COLUMN is not
14127 evenly divisible into the number of bytes needed to store in memory a
14128 datum indicated by TYPE.
14130 `GL_INVALID_OPERATION' is generated if `glSeparableFilter2D' is executed
14131 between the execution of `glBegin' and the corresponding execution of
14134 (define-gl-procedure
14135 ((glShadeModel (mode GLenum) -> void))
14136 "Select flat or smooth shading.
14139 Specifies a symbolic value representing a shading technique.
14140 Accepted values are `GL_FLAT' and `GL_SMOOTH'. The initial value is
14143 GL primitives can have either flat or smooth shading. Smooth shading,
14144 the default, causes the computed colors of vertices to be interpolated
14145 as the primitive is rasterized, typically assigning different colors to
14146 each resulting pixel fragment. Flat shading selects the computed color
14147 of just one vertex and assigns it to all the pixel fragments generated
14148 by rasterizing a single primitive. In either case, the computed color of
14149 a vertex is the result of lighting if lighting is enabled, or it is the
14150 current color at the time the vertex was specified if lighting is
14153 Flat and smooth shading are indistinguishable for points. Starting when
14154 `glBegin' is issued and counting vertices and primitives from 1, the GL
14155 gives each flat-shaded line segment I the computed color of vertex I+1 ,
14156 its second vertex. Counting similarly from 1, the GL gives each
14157 flat-shaded polygon the computed color of the vertex listed in the
14158 following table. This is the last vertex to specify the polygon in all
14159 cases except single polygons, where the first vertex specifies the
14164 * Primitive Type of Polygon I *
14167 Single polygon (I==1 )
14176 Independent triangle
14185 Flat and smooth shading are specified by `glShadeModel' with MODE set to
14186 `GL_FLAT' and `GL_SMOOTH', respectively.
14188 `GL_INVALID_ENUM' is generated if MODE is any value other than `GL_FLAT'
14191 `GL_INVALID_OPERATION' is generated if `glShadeModel' is executed
14192 between the execution of `glBegin' and the corresponding execution of
14195 (define-gl-procedure
14203 "Replaces the source code in a shader object.
14206 Specifies the handle of the shader object whose source code is to
14210 Specifies the number of elements in the STRING and LENGTH arrays.
14213 Specifies an array of pointers to strings containing the source
14214 code to be loaded into the shader.
14217 Specifies an array of string lengths.
14219 `glShaderSource' sets the source code in SHADER to the source code in
14220 the array of strings specified by STRING. Any source code previously
14221 stored in the shader object is completely replaced. The number of
14222 strings in the array is specified by COUNT. If LENGTH is `NULL', each
14223 string is assumed to be null terminated. If LENGTH is a value other than
14224 `NULL', it points to an array containing a string length for each of the
14225 corresponding elements of STRING. Each element in the LENGTH array may
14226 contain the length of the corresponding string (the null character is
14227 not counted as part of the string length) or a value less than 0 to
14228 indicate that the string is null terminated. The source code strings are
14229 not scanned or parsed at this time; they are simply copied into the
14230 specified shader object.
14232 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
14235 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
14237 `GL_INVALID_VALUE' is generated if COUNT is less than 0.
14239 `GL_INVALID_OPERATION' is generated if `glShaderSource' is executed
14240 between the execution of `glBegin' and the corresponding execution of
14243 (define-gl-procedure
14244 ((glStencilFuncSeparate
14251 "Set front and/or back function and reference value for stencil testing.
14254 Specifies whether front and/or back stencil state is updated. Three
14255 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
14256 `GL_FRONT_AND_BACK'.
14259 Specifies the test function. Eight symbolic constants are valid:
14260 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
14261 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
14265 Specifies the reference value for the stencil test. REF is clamped
14266 to the range [0,2^N-1] , where N is the number of bitplanes in the
14267 stencil buffer. The initial value is 0.
14270 Specifies a mask that is ANDed with both the reference value and
14271 the stored stencil value when the test is done. The initial value
14274 Stenciling, like depth-buffering, enables and disables drawing on a
14275 per-pixel basis. You draw into the stencil planes using GL drawing
14276 primitives, then render geometry and images, using the stencil planes to
14277 mask out portions of the screen. Stenciling is typically used in
14278 multipass rendering algorithms to achieve special effects, such as
14279 decals, outlining, and constructive solid geometry rendering.
14281 The stencil test conditionally eliminates a pixel based on the outcome
14282 of a comparison between the reference value and the value in the stencil
14283 buffer. To enable and disable the test, call `glEnable' and `glDisable'
14284 with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
14285 of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
14287 There can be two separate sets of FUNC, REF, and MASK parameters; one
14288 affects back-facing polygons, and the other affects front-facing
14289 polygons as well as other non-polygon primitives. `glStencilFunc' sets
14290 both front and back stencil state to the same values, as if
14291 `glStencilFuncSeparate' were called with FACE set to
14292 `GL_FRONT_AND_BACK'.
14294 FUNC is a symbolic constant that determines the stencil comparison
14295 function. It accepts one of eight values, shown in the following list.
14296 REF is an integer reference value that is used in the stencil
14297 comparison. It is clamped to the range [0,2^N-1] , where N is the number
14298 of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
14299 reference value and the stored stencil value, with the ANDed values
14300 participating in the comparison.
14302 If STENCIL represents the value stored in the corresponding stencil
14303 buffer location, the following list shows the effect of each comparison
14304 function that can be specified by FUNC. Only if the comparison succeeds
14305 is the pixel passed through to the next stage in the rasterization
14306 process (see `glStencilOp'). All tests treat STENCIL values as unsigned
14307 integers in the range [0,2^N-1] , where N is the number of bitplanes in
14308 the stencil buffer.
14310 The following values are accepted by FUNC:
14316 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
14319 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
14322 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
14325 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
14328 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
14331 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
14336 `GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
14339 `GL_INVALID_OPERATION' is generated if `glStencilFuncSeparate' is
14340 executed between the execution of `glBegin' and the corresponding
14341 execution of `glEnd'.")
14343 (define-gl-procedure
14350 "Set front and back function and reference value for stencil testing.
14353 Specifies the test function. Eight symbolic constants are valid:
14354 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
14355 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
14359 Specifies the reference value for the stencil test. REF is clamped
14360 to the range [0,2^N-1] , where N is the number of bitplanes in the
14361 stencil buffer. The initial value is 0.
14364 Specifies a mask that is ANDed with both the reference value and
14365 the stored stencil value when the test is done. The initial value
14368 Stenciling, like depth-buffering, enables and disables drawing on a
14369 per-pixel basis. Stencil planes are first drawn into using GL drawing
14370 primitives, then geometry and images are rendered using the stencil
14371 planes to mask out portions of the screen. Stenciling is typically used
14372 in multipass rendering algorithms to achieve special effects, such as
14373 decals, outlining, and constructive solid geometry rendering.
14375 The stencil test conditionally eliminates a pixel based on the outcome
14376 of a comparison between the reference value and the value in the stencil
14377 buffer. To enable and disable the test, call `glEnable' and `glDisable'
14378 with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
14379 of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
14381 There can be two separate sets of FUNC, REF, and MASK parameters; one
14382 affects back-facing polygons, and the other affects front-facing
14383 polygons as well as other non-polygon primitives. `glStencilFunc' sets
14384 both front and back stencil state to the same values. Use
14385 `glStencilFuncSeparate' to set front and back stencil state to different
14388 FUNC is a symbolic constant that determines the stencil comparison
14389 function. It accepts one of eight values, shown in the following list.
14390 REF is an integer reference value that is used in the stencil
14391 comparison. It is clamped to the range [0,2^N-1] , where N is the number
14392 of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
14393 reference value and the stored stencil value, with the ANDed values
14394 participating in the comparison.
14396 If STENCIL represents the value stored in the corresponding stencil
14397 buffer location, the following list shows the effect of each comparison
14398 function that can be specified by FUNC. Only if the comparison succeeds
14399 is the pixel passed through to the next stage in the rasterization
14400 process (see `glStencilOp'). All tests treat STENCIL values as unsigned
14401 integers in the range [0,2^N-1] , where N is the number of bitplanes in
14402 the stencil buffer.
14404 The following values are accepted by FUNC:
14410 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
14413 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
14416 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
14419 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
14422 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
14425 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
14430 `GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
14433 `GL_INVALID_OPERATION' is generated if `glStencilFunc' is executed
14434 between the execution of `glBegin' and the corresponding execution of
14437 (define-gl-procedure
14438 ((glStencilMaskSeparate
14443 "Control the front and/or back writing of individual bits in the stencil
14447 Specifies whether the front and/or back stencil writemask is
14448 updated. Three symbolic constants are valid: `GL_FRONT', `GL_BACK',
14449 and `GL_FRONT_AND_BACK'.
14452 Specifies a bit mask to enable and disable writing of individual
14453 bits in the stencil planes. Initially, the mask is all 1's.
14455 `glStencilMaskSeparate' controls the writing of individual bits in the
14456 stencil planes. The least significant N bits of MASK, where N is the
14457 number of bits in the stencil buffer, specify a mask. Where a 1 appears
14458 in the mask, it's possible to write to the corresponding bit in the
14459 stencil buffer. Where a 0 appears, the corresponding bit is
14460 write-protected. Initially, all bits are enabled for writing.
14462 There can be two separate MASK writemasks; one affects back-facing
14463 polygons, and the other affects front-facing polygons as well as other
14464 non-polygon primitives. `glStencilMask' sets both front and back stencil
14465 writemasks to the same values, as if `glStencilMaskSeparate' were called
14466 with FACE set to `GL_FRONT_AND_BACK'.
14468 `GL_INVALID_OPERATION' is generated if `glStencilMaskSeparate' is
14469 executed between the execution of `glBegin' and the corresponding
14470 execution of `glEnd'.")
14472 (define-gl-procedure
14473 ((glStencilMask (mask GLuint) -> void))
14474 "Control the front and back writing of individual bits in the stencil
14478 Specifies a bit mask to enable and disable writing of individual
14479 bits in the stencil planes. Initially, the mask is all 1's.
14481 `glStencilMask' controls the writing of individual bits in the stencil
14482 planes. The least significant N bits of MASK, where N is the number of
14483 bits in the stencil buffer, specify a mask. Where a 1 appears in the
14484 mask, it's possible to write to the corresponding bit in the stencil
14485 buffer. Where a 0 appears, the corresponding bit is write-protected.
14486 Initially, all bits are enabled for writing.
14488 There can be two separate MASK writemasks; one affects back-facing
14489 polygons, and the other affects front-facing polygons as well as other
14490 non-polygon primitives. `glStencilMask' sets both front and back stencil
14491 writemasks to the same values. Use `glStencilMaskSeparate' to set front
14492 and back stencil writemasks to different values.
14494 `GL_INVALID_OPERATION' is generated if `glStencilMask' is executed
14495 between the execution of `glBegin' and the corresponding execution of
14498 (define-gl-procedure
14499 ((glStencilOpSeparate
14506 "Set front and/or back stencil test actions.
14509 Specifies whether front and/or back stencil state is updated. Three
14510 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
14511 `GL_FRONT_AND_BACK'.
14514 Specifies the action to take when the stencil test fails. Eight
14515 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
14516 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
14517 and `GL_INVERT'. The initial value is `GL_KEEP'.
14520 Specifies the stencil action when the stencil test passes, but the
14521 depth test fails. DPFAIL accepts the same symbolic constants as
14522 SFAIL. The initial value is `GL_KEEP'.
14525 Specifies the stencil action when both the stencil test and the
14526 depth test pass, or when the stencil test passes and either there
14527 is no depth buffer or depth testing is not enabled. DPPASS accepts
14528 the same symbolic constants as SFAIL. The initial value is
14531 Stenciling, like depth-buffering, enables and disables drawing on a
14532 per-pixel basis. You draw into the stencil planes using GL drawing
14533 primitives, then render geometry and images, using the stencil planes to
14534 mask out portions of the screen. Stenciling is typically used in
14535 multipass rendering algorithms to achieve special effects, such as
14536 decals, outlining, and constructive solid geometry rendering.
14538 The stencil test conditionally eliminates a pixel based on the outcome
14539 of a comparison between the value in the stencil buffer and a reference
14540 value. To enable and disable the test, call `glEnable' and `glDisable'
14541 with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
14542 `glStencilFuncSeparate'.
14544 There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
14545 one affects back-facing polygons, and the other affects front-facing
14546 polygons as well as other non-polygon primitives. `glStencilOp' sets
14547 both front and back stencil state to the same values, as if
14548 `glStencilOpSeparate' were called with FACE set to `GL_FRONT_AND_BACK'.
14550 `glStencilOpSeparate' takes three arguments that indicate what happens
14551 to the stored stencil value while stenciling is enabled. If the stencil
14552 test fails, no change is made to the pixel's color or depth buffers, and
14553 SFAIL specifies what happens to the stencil buffer contents. The
14554 following eight actions are possible.
14557 Keeps the current value.
14560 Sets the stencil buffer value to 0.
14563 Sets the stencil buffer value to REF, as specified by
14567 Increments the current stencil buffer value. Clamps to the maximum
14568 representable unsigned value.
14571 Increments the current stencil buffer value. Wraps stencil buffer
14572 value to zero when incrementing the maximum representable unsigned
14576 Decrements the current stencil buffer value. Clamps to 0.
14579 Decrements the current stencil buffer value. Wraps stencil buffer
14580 value to the maximum representable unsigned value when decrementing
14581 a stencil buffer value of zero.
14584 Bitwise inverts the current stencil buffer value.
14586 Stencil buffer values are treated as unsigned integers. When incremented
14587 and decremented, values are clamped to 0 and 2^N-1 , where N is the
14588 value returned by querying `GL_STENCIL_BITS'.
14590 The other two arguments to `glStencilOpSeparate' specify stencil buffer
14591 actions that depend on whether subsequent depth buffer tests succeed
14592 (DPPASS) or fail (DPFAIL) (see `glDepthFunc'). The actions are specified
14593 using the same eight symbolic constants as SFAIL. Note that DPFAIL is
14594 ignored when there is no depth buffer, or when the depth buffer is not
14595 enabled. In these cases, SFAIL and DPPASS specify stencil action when
14596 the stencil test fails and passes, respectively.
14598 `GL_INVALID_ENUM' is generated if FACE is any value other than
14599 `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
14601 `GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
14602 other than the eight defined constant values.
14604 `GL_INVALID_OPERATION' is generated if `glStencilOpSeparate' is executed
14605 between the execution of `glBegin' and the corresponding execution of
14608 (define-gl-procedure
14615 "Set front and back stencil test actions.
14618 Specifies the action to take when the stencil test fails. Eight
14619 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
14620 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
14621 and `GL_INVERT'. The initial value is `GL_KEEP'.
14624 Specifies the stencil action when the stencil test passes, but the
14625 depth test fails. DPFAIL accepts the same symbolic constants as
14626 SFAIL. The initial value is `GL_KEEP'.
14629 Specifies the stencil action when both the stencil test and the
14630 depth test pass, or when the stencil test passes and either there
14631 is no depth buffer or depth testing is not enabled. DPPASS accepts
14632 the same symbolic constants as SFAIL. The initial value is
14635 Stenciling, like depth-buffering, enables and disables drawing on a
14636 per-pixel basis. You draw into the stencil planes using GL drawing
14637 primitives, then render geometry and images, using the stencil planes to
14638 mask out portions of the screen. Stenciling is typically used in
14639 multipass rendering algorithms to achieve special effects, such as
14640 decals, outlining, and constructive solid geometry rendering.
14642 The stencil test conditionally eliminates a pixel based on the outcome
14643 of a comparison between the value in the stencil buffer and a reference
14644 value. To enable and disable the test, call `glEnable' and `glDisable'
14645 with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
14646 `glStencilFuncSeparate'.
14648 There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
14649 one affects back-facing polygons, and the other affects front-facing
14650 polygons as well as other non-polygon primitives. `glStencilOp' sets
14651 both front and back stencil state to the same values. Use
14652 `glStencilOpSeparate' to set front and back stencil state to different
14655 `glStencilOp' takes three arguments that indicate what happens to the
14656 stored stencil value while stenciling is enabled. If the stencil test
14657 fails, no change is made to the pixel's color or depth buffers, and
14658 SFAIL specifies what happens to the stencil buffer contents. The
14659 following eight actions are possible.
14662 Keeps the current value.
14665 Sets the stencil buffer value to 0.
14668 Sets the stencil buffer value to REF, as specified by
14672 Increments the current stencil buffer value. Clamps to the maximum
14673 representable unsigned value.
14676 Increments the current stencil buffer value. Wraps stencil buffer
14677 value to zero when incrementing the maximum representable unsigned
14681 Decrements the current stencil buffer value. Clamps to 0.
14684 Decrements the current stencil buffer value. Wraps stencil buffer
14685 value to the maximum representable unsigned value when decrementing
14686 a stencil buffer value of zero.
14689 Bitwise inverts the current stencil buffer value.
14691 Stencil buffer values are treated as unsigned integers. When incremented
14692 and decremented, values are clamped to 0 and 2^N-1 , where N is the
14693 value returned by querying `GL_STENCIL_BITS'.
14695 The other two arguments to `glStencilOp' specify stencil buffer actions
14696 that depend on whether subsequent depth buffer tests succeed (DPPASS) or
14697 fail (DPFAIL) (see `glDepthFunc'). The actions are specified using the
14698 same eight symbolic constants as SFAIL. Note that DPFAIL is ignored when
14699 there is no depth buffer, or when the depth buffer is not enabled. In
14700 these cases, SFAIL and DPPASS specify stencil action when the stencil
14701 test fails and passes, respectively.
14703 `GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
14704 other than the eight defined constant values.
14706 `GL_INVALID_OPERATION' is generated if `glStencilOp' is executed between
14707 the execution of `glBegin' and the corresponding execution of `glEnd'.")
14709 (define-gl-procedure
14710 ((glTexCoordPointer
14717 "Define an array of texture coordinates.
14720 Specifies the number of coordinates per array element. Must be 1,
14721 2, 3, or 4. The initial value is 4.
14724 Specifies the data type of each texture coordinate. Symbolic
14725 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
14726 accepted. The initial value is `GL_FLOAT'.
14729 Specifies the byte offset between consecutive texture coordinate
14730 sets. If STRIDE is 0, the array elements are understood to be
14731 tightly packed. The initial value is 0.
14734 Specifies a pointer to the first coordinate of the first texture
14735 coordinate set in the array. The initial value is 0.
14737 `glTexCoordPointer' specifies the location and data format of an array
14738 of texture coordinates to use when rendering. SIZE specifies the number
14739 of coordinates per texture coordinate set, and must be 1, 2, 3, or 4.
14740 TYPE specifies the data type of each texture coordinate, and STRIDE
14741 specifies the byte stride from one texture coordinate set to the next,
14742 allowing vertices and attributes to be packed into a single array or
14743 stored in separate arrays. (Single-array storage may be more efficient
14744 on some implementations; see `glInterleavedArrays'.)
14746 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
14747 target (see `glBindBuffer') while a texture coordinate array is
14748 specified, POINTER is treated as a byte offset into the buffer object's
14749 data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
14750 is saved as texture coordinate vertex array client-side state
14751 (`GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING').
14753 When a texture coordinate array is specified, SIZE, TYPE, STRIDE, and
14754 POINTER are saved as client-side state, in addition to the current
14755 vertex array buffer object binding.
14757 To enable and disable a texture coordinate array, call
14758 `glEnableClientState' and `glDisableClientState' with the argument
14759 `GL_TEXTURE_COORD_ARRAY'. If enabled, the texture coordinate array is
14760 used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
14761 `glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
14764 `GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
14766 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
14768 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
14770 (define-gl-procedure
14771 ((glTexCoord1i (s GLint) -> void)
14772 (glTexCoord1d (s GLdouble) -> void)
14773 (glTexCoord2i (s GLint) (t GLint) -> void)
14774 (glTexCoord2d (s GLdouble) (t GLdouble) -> void)
14801 "Set the current texture coordinates.
14810 Specify S, T, R, and Q texture coordinates. Not all parameters are
14811 present in all forms of the command.
14813 `glTexCoord' specifies texture coordinates in one, two, three, or four
14814 dimensions. `glTexCoord1' sets the current texture coordinates to
14815 (S,001) ; a call to `glTexCoord2' sets them to (S,T01) . Similarly,
14816 `glTexCoord3' specifies the texture coordinates as (S,TR1) , and
14817 `glTexCoord4' defines all four components explicitly as (S,TRQ) .
14819 The current texture coordinates are part of the data that is associated
14820 with each vertex and with the current raster position. Initially, the
14821 values for S, T, R, and Q are (0, 0, 0, 1).")
14823 (define-gl-procedure
14836 "Set texture environment parameters.
14839 Specifies a texture environment. May be `GL_TEXTURE_ENV',
14840 `GL_TEXTURE_FILTER_CONTROL' or `GL_POINT_SPRITE'.
14843 Specifies the symbolic name of a single-valued texture environment
14844 parameter. May be either `GL_TEXTURE_ENV_MODE',
14845 `GL_TEXTURE_LOD_BIAS', `GL_COMBINE_RGB', `GL_COMBINE_ALPHA',
14846 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14847 `GL_SRC1_ALPHA', `GL_SRC2_ALPHA', `GL_OPERAND0_RGB',
14848 `GL_OPERAND1_RGB', `GL_OPERAND2_RGB', `GL_OPERAND0_ALPHA',
14849 `GL_OPERAND1_ALPHA', `GL_OPERAND2_ALPHA', `GL_RGB_SCALE',
14850 `GL_ALPHA_SCALE', or `GL_COORD_REPLACE'.
14853 Specifies a single symbolic constant, one of `GL_ADD',
14854 `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_MODULATE', `GL_DECAL',
14855 `GL_BLEND', `GL_REPLACE', `GL_SUBTRACT', `GL_COMBINE',
14856 `GL_TEXTURE', `GL_CONSTANT', `GL_PRIMARY_COLOR', `GL_PREVIOUS',
14857 `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_SRC_ALPHA',
14858 `GL_ONE_MINUS_SRC_ALPHA', a single boolean value for the point
14859 sprite texture coordinate replacement, a single floating-point
14860 value for the texture level-of-detail bias, or 1.0, 2.0, or 4.0
14861 when specifying the `GL_RGB_SCALE' or `GL_ALPHA_SCALE'.
14863 A texture environment specifies how texture values are interpreted when
14864 a fragment is textured. When TARGET is `GL_TEXTURE_FILTER_CONTROL',
14865 PNAME must be `GL_TEXTURE_LOD_BIAS'. When TARGET is `GL_TEXTURE_ENV',
14866 PNAME can be `GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR',
14867 `GL_COMBINE_RGB', `GL_COMBINE_ALPHA', `GL_RGB_SCALE', `GL_ALPHA_SCALE',
14868 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14869 `GL_SRC1_ALPHA', or `GL_SRC2_ALPHA'.
14871 If PNAME is `GL_TEXTURE_ENV_MODE', then PARAMS is (or points to) the
14872 symbolic name of a texture function. Six texture functions may be
14873 specified: `GL_ADD', `GL_MODULATE', `GL_DECAL', `GL_BLEND',
14874 `GL_REPLACE', or `GL_COMBINE'.
14876 The following table shows the correspondence of filtered texture values
14877 R_T , G_T , B_T , A_T , L_T , I_T to texture source components. C_S and
14878 A_S are used by the texture functions described below.
14882 Texture Base Internal Format
14889 ( L_T , L_T , L_T ) , 1
14891 `GL_LUMINANCE_ALPHA'
14892 ( L_T , L_T , L_T ) , A_T
14895 ( I_T , I_T , I_T ) , I_T
14898 ( R_T , G_T , B_T ) , 1
14901 ( R_T , G_T , B_T ) , A_T
14903 A texture function acts on the fragment to be textured using the texture
14904 image value that applies to the fragment (see `glTexParameter') and
14905 produces an RGBA color for that fragment. The following table shows how
14906 the RGBA color is produced for each of the first five texture functions
14907 that can be chosen. C is a triple of color values (RGB) and A is the
14908 associated alpha value. RGBA values extracted from a texture image are
14909 in the range [0,1]. The subscript P refers to the color computed from
14910 the previous texture stage (or the incoming fragment if processing
14911 texture stage 0), the subscript S to the texture source color, the
14912 subscript C to the texture environment color, and the subscript V
14913 indicates a value produced by the texture function.
14917 Texture Base Internal Format
14918 `Value', `GL_REPLACE' Function , `GL_MODULATE' Function ,
14919 `GL_DECAL' Function , `GL_BLEND' Function , `GL_ADD' Function
14922 C_V= , C_P , C_P , undefined , C_P , C_P
14925 A_V= , A_S , A_P\u2062A_S , , A_V=A_P\u2062A_S , A_P\u2062A_S
14928 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14931 A_V= , A_P , A_P , , A_P , A_P
14933 `GL_LUMINANCE_ALPHA'
14934 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14937 A_V= , A_S , A_P\u2062A_S , , A_P\u2062A_S , A_P\u2062A_S
14940 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14943 A_V= , A_S , A_P\u2062A_S , , A_P\u2062(1-A_S,)+A_C\u2062A_S , A_P+A_S
14946 C_V= , C_S , C_P\u2062C_S , C_S , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14949 A_V= , A_P , A_P , A_P , A_P , A_P
14952 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
14956 A_V= , A_S , A_P\u2062A_S , A_P , A_P\u2062A_S , A_P\u2062A_S
14958 If PNAME is `GL_TEXTURE_ENV_MODE', and PARAMS is `GL_COMBINE', the form
14959 of the texture function depends on the values of `GL_COMBINE_RGB' and
14960 `GL_COMBINE_ALPHA'.
14962 The following describes how the texture sources, as specified by
14963 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14964 `GL_SRC1_ALPHA', and `GL_SRC2_ALPHA', are combined to produce a final
14965 texture color. In the following tables, `GL_SRC0_c' is represented by
14966 ARG0 , `GL_SRC1_c' is represented by ARG1 , and `GL_SRC2_c' is
14967 represented by ARG2 .
14969 `GL_COMBINE_RGB' accepts any of `GL_REPLACE', `GL_MODULATE', `GL_ADD',
14970 `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_SUBTRACT', `GL_DOT3_RGB', or
14991 ARG0×ARG2+ARG1×(1-ARG2,)
14996 `GL_DOT3_RGB' or `GL_DOT3_RGBA'
14997 4×(((ARG0_R,-0.5,)×(ARG1_R,-0.5,),)+((ARG0_G,-0.5,)×(ARG1_G,-0.5,),
14998 )+((ARG0_B,-0.5,)×(ARG1_B,-0.5,),),)
15000 The scalar results for `GL_DOT3_RGB' and `GL_DOT3_RGBA' are placed into
15001 each of the 3 (RGB) or 4 (RGBA) components on output.
15003 Likewise, `GL_COMBINE_ALPHA' accepts any of `GL_REPLACE', `GL_MODULATE',
15004 `GL_ADD', `GL_ADD_SIGNED', `GL_INTERPOLATE', or `GL_SUBTRACT'. The
15005 following table describes how alpha values are combined:
15009 *`GL_COMBINE_ALPHA'*
15025 ARG0×ARG2+ARG1×(1-ARG2,)
15030 In the following tables, the value C_S represents the color sampled from
15031 the currently bound texture, C_C represents the constant
15032 texture-environment color, C_F represents the primary color of the
15033 incoming fragment, and C_P represents the color computed from the
15034 previous texture stage or C_F if processing texture stage 0. Likewise,
15035 A_S , A_C , A_F , and A_P represent the respective alpha values.
15037 The following table describes the values assigned to ARG0 , ARG1 , and
15038 ARG2 based upon the RGB sources and operands:
15043 *`GL_OPERANDn_RGB'*, *Argument Value*
15046 `GL_SRC_COLOR', C_S,
15049 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
15052 `GL_SRC_ALPHA', A_S,
15055 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15058 `GL_SRC_COLOR', C_S,
15061 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
15064 `GL_SRC_ALPHA', A_S,
15067 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15070 `GL_SRC_COLOR', C_C,
15073 `GL_ONE_MINUS_SRC_COLOR', 1-C_C,
15076 `GL_SRC_ALPHA', A_C,
15079 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
15082 `GL_SRC_COLOR', C_F,
15085 `GL_ONE_MINUS_SRC_COLOR', 1-C_F,
15088 `GL_SRC_ALPHA', A_F,
15091 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
15094 `GL_SRC_COLOR', C_P,
15097 `GL_ONE_MINUS_SRC_COLOR', 1-C_P,
15100 `GL_SRC_ALPHA', A_P,
15103 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
15105 For `GL_TEXTUREn' sources, C_S and A_S represent the color and alpha,
15106 respectively, produced from texture stage N .
15108 The follow table describes the values assigned to ARG0 , ARG1 , and ARG2
15109 based upon the alpha sources and operands:
15114 *`GL_OPERANDn_ALPHA'*, *Argument Value*
15117 `GL_SRC_ALPHA', A_S,
15120 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15123 `GL_SRC_ALPHA', A_S,
15126 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15129 `GL_SRC_ALPHA', A_C,
15132 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
15135 `GL_SRC_ALPHA', A_F,
15138 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
15141 `GL_SRC_ALPHA', A_P,
15144 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
15146 The RGB and alpha results of the texture function are multipled by the
15147 values of `GL_RGB_SCALE' and `GL_ALPHA_SCALE', respectively, and clamped
15148 to the range [0,1] .
15150 If PNAME is `GL_TEXTURE_ENV_COLOR', PARAMS is a pointer to an array that
15151 holds an RGBA color consisting of four values. Integer color components
15152 are interpreted linearly such that the most positive integer maps to
15153 1.0, and the most negative integer maps to -1.0. The values are clamped
15154 to the range [0,1] when they are specified. C_C takes these four values.
15156 If PNAME is `GL_TEXTURE_LOD_BIAS', the value specified is added to the
15157 texture level-of-detail parameter, that selects which mipmap, or mipmaps
15158 depending upon the selected `GL_TEXTURE_MIN_FILTER', will be sampled.
15160 `GL_TEXTURE_ENV_MODE' defaults to `GL_MODULATE' and
15161 `GL_TEXTURE_ENV_COLOR' defaults to (0, 0, 0, 0).
15163 If TARGET is `GL_POINT_SPRITE' and PNAME is `GL_COORD_REPLACE', the
15164 boolean value specified is used to either enable or disable point sprite
15165 texture coordinate replacement. The default value is `GL_FALSE'.
15167 `GL_INVALID_ENUM' is generated when TARGET or PNAME is not one of the
15168 accepted defined values, or when PARAMS should have a defined constant
15169 value (based on the value of PNAME) and does not.
15171 `GL_INVALID_VALUE' is generated if the PARAMS value for `GL_RGB_SCALE'
15172 or `GL_ALPHA_SCALE' are not one of 1.0, 2.0, or 4.0.
15174 `GL_INVALID_OPERATION' is generated if `glTexEnv' is executed between
15175 the execution of `glBegin' and the corresponding execution of `glEnd'.")
15177 (define-gl-procedure
15190 "Control the generation of texture coordinates.
15193 Specifies a texture coordinate. Must be one of `GL_S', `GL_T',
15197 Specifies the symbolic name of the texture-coordinate generation
15198 function. Must be `GL_TEXTURE_GEN_MODE'.
15201 Specifies a single-valued texture generation parameter, one of
15202 `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP',
15203 `GL_NORMAL_MAP', or `GL_REFLECTION_MAP'.
15205 `glTexGen' selects a texture-coordinate generation function or supplies
15206 coefficients for one of the functions. COORD names one of the (S, T, R,
15207 Q) texture coordinates; it must be one of the symbols `GL_S', `GL_T',
15208 `GL_R', or `GL_Q'. PNAME must be one of three symbolic constants:
15209 `GL_TEXTURE_GEN_MODE', `GL_OBJECT_PLANE', or `GL_EYE_PLANE'. If PNAME is
15210 `GL_TEXTURE_GEN_MODE', then PARAMS chooses a mode, one of
15211 `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP', `GL_NORMAL_MAP',
15212 or `GL_REFLECTION_MAP'. If PNAME is either `GL_OBJECT_PLANE' or
15213 `GL_EYE_PLANE', PARAMS contains coefficients for the corresponding
15214 texture generation function.
15216 If the texture generation function is `GL_OBJECT_LINEAR', the function
15218 G=P_1×X_O+P_2×Y_O+P_3×Z_O+P_4×W_O
15220 is used, where G is the value computed for the coordinate named in
15221 COORD, P_1 , P_2 , P_3 , and P_4 are the four values supplied in PARAMS,
15222 and X_O , Y_O , Z_O , and W_O are the object coordinates of the vertex.
15223 This function can be used, for example, to texture-map terrain using sea
15224 level as a reference plane (defined by P_1 , P_2 , P_3 , and P_4 ). The
15225 altitude of a terrain vertex is computed by the `GL_OBJECT_LINEAR'
15226 coordinate generation function as its distance from sea level; that
15227 altitude can then be used to index the texture image to map white snow
15228 onto peaks and green grass onto foothills.
15230 If the texture generation function is `GL_EYE_LINEAR', the function
15232 G=P_1,^″×X_E+P_2,^″×Y_E+P_3,^″×Z_E+P_4,^″×W_E
15236 (P_1,^″\u2062P_2,^″\u2062P_3,^″\u2062P_4,^″,)=(P_1\u2062P_2\u2062P_3\u2062P_4,)\u2062M^-1
15238 and X_E , Y_E , Z_E , and W_E are the eye coordinates of the vertex, P_1
15239 , P_2 , P_3 , and P_4 are the values supplied in PARAMS, and M is the
15240 modelview matrix when `glTexGen' is invoked. If M is poorly conditioned
15241 or singular, texture coordinates generated by the resulting function may
15242 be inaccurate or undefined.
15244 Note that the values in PARAMS define a reference plane in eye
15245 coordinates. The modelview matrix that is applied to them may not be the
15246 same one in effect when the polygon vertices are transformed. This
15247 function establishes a field of texture coordinates that can produce
15248 dynamic contour lines on moving objects.
15250 If the texture generation function is `GL_SPHERE_MAP' and COORD is
15251 either `GL_S' or `GL_T', S and T texture coordinates are generated as
15252 follows. Let U be the unit vector pointing from the origin to the
15253 polygon vertex (in eye coordinates). Let N sup prime be the current
15254 normal, after transformation to eye coordinates. Let
15256 F=(F_X\u2062F_Y\u2062F_Z,)^T be the reflection vector such that
15258 F=U-2\u2062N^″\u2062N^″,^T\u2062U
15260 Finally, let M=2\u2062√(F_X,^2+F_Y,^2+(F_Z+1,)^2,) . Then the values assigned
15261 to the S and T texture coordinates are
15267 To enable or disable a texture-coordinate generation function, call
15268 `glEnable' or `glDisable' with one of the symbolic texture-coordinate
15269 names (`GL_TEXTURE_GEN_S', `GL_TEXTURE_GEN_T', `GL_TEXTURE_GEN_R', or
15270 `GL_TEXTURE_GEN_Q') as the argument. When enabled, the specified texture
15271 coordinate is computed according to the generating function associated
15272 with that coordinate. When disabled, subsequent vertices take the
15273 specified texture coordinate from the current set of texture
15274 coordinates. Initially, all texture generation functions are set to
15275 `GL_EYE_LINEAR' and are disabled. Both S plane equations are (1, 0, 0,
15276 0), both T plane equations are (0, 1, 0, 0), and all R and Q plane
15277 equations are (0, 0, 0, 0).
15279 When the `ARB_multitexture' extension is supported, `glTexGen' sets the
15280 texture generation parameters for the currently active texture unit,
15281 selected with `glActiveTexture'.
15283 `GL_INVALID_ENUM' is generated when COORD or PNAME is not an accepted
15284 defined value, or when PNAME is `GL_TEXTURE_GEN_MODE' and PARAMS is not
15285 an accepted defined value.
15287 `GL_INVALID_ENUM' is generated when PNAME is `GL_TEXTURE_GEN_MODE',
15288 PARAMS is `GL_SPHERE_MAP', and COORD is either `GL_R' or `GL_Q'.
15290 `GL_INVALID_OPERATION' is generated if `glTexGen' is executed between
15291 the execution of `glBegin' and the corresponding execution of `glEnd'.")
15293 (define-gl-procedure
15297 (internalFormat GLint)
15305 "Specify a one-dimensional texture image.
15308 Specifies the target texture. Must be `GL_TEXTURE_1D' or
15309 `GL_PROXY_TEXTURE_1D'.
15312 Specifies the level-of-detail number. Level 0 is the base image
15313 level. Level N is the Nth mipmap reduction image.
15316 Specifies the number of color components in the texture. Must be 1,
15317 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
15318 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15319 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
15320 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
15321 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
15322 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
15323 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
15324 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
15325 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15326 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15327 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15328 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
15329 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
15330 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
15331 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
15332 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
15333 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
15334 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
15338 Specifies the width of the texture image including the border if
15339 any. If the GL version does not support non-power-of-two sizes,
15340 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
15341 implementations support texture images that are at least 64 texels
15342 wide. The height of the 1D texture image is 1.
15345 Specifies the width of the border. Must be either 0 or 1.
15348 Specifies the format of the pixel data. The following symbolic
15349 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
15350 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
15351 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
15354 Specifies the data type of the pixel data. The following symbolic
15355 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
15356 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
15357 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15358 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
15359 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15360 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15361 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15362 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
15365 Specifies a pointer to the image data in memory.
15367 Texturing maps a portion of a specified texture image onto each
15368 graphical primitive for which texturing is enabled. To enable and
15369 disable one-dimensional texturing, call `glEnable' and `glDisable' with
15370 argument `GL_TEXTURE_1D'.
15372 Texture images are defined with `glTexImage1D'. The arguments describe
15373 the parameters of the texture image, such as width, width of the border,
15374 level-of-detail number (see `glTexParameter'), and the internal
15375 resolution and format used to store the image. The last three arguments
15376 describe how the image is represented in memory; they are identical to
15377 the pixel formats used for `glDrawPixels'.
15379 If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
15380 of the texture image state is recalculated, checked for consistency, and
15381 checked against the implementation's capabilities. If the implementation
15382 cannot handle a texture of the requested texture size, it sets all of
15383 the image state to 0, but does not generate an error (see `glGetError').
15384 To query for an entire mipmap array, use an image array level greater
15385 than or equal to 1.
15387 If TARGET is `GL_TEXTURE_1D', data is read from DATA as a sequence of
15388 signed or unsigned bytes, shorts, or longs, or single-precision
15389 floating-point values, depending on TYPE. These values are grouped into
15390 sets of one, two, three, or four values, depending on FORMAT, to form
15391 elements. If TYPE is `GL_BITMAP', the data is considered as a string of
15392 unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
15393 treated as eight 1-bit elements, with bit ordering determined by
15394 `GL_UNPACK_LSB_FIRST' (see `glPixelStore').
15396 If a non-zero named buffer object is bound to the
15397 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
15398 image is specified, DATA is treated as a byte offset into the buffer
15399 object's data store.
15401 The first element corresponds to the left end of the texture array.
15402 Subsequent elements progress left-to-right through the remaining texels
15403 in the texture array. The final element corresponds to the right end of
15406 FORMAT determines the composition of each element in DATA. It can assume
15407 one of these symbolic values:
15410 Each element is a single value, a color index. The GL converts it
15411 to fixed point (with an unspecified number of zero bits to the
15412 right of the binary point), shifted left or right depending on the
15413 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
15414 (see `glPixelTransfer'). The resulting index is converted to a set
15415 of color components using the `GL_PIXEL_MAP_I_TO_R',
15416 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
15417 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
15420 Each element is a single red component. The GL converts it to
15421 floating point and assembles it into an RGBA element by attaching 0
15422 for green and blue, and 1 for alpha. Each component is then
15423 multiplied by the signed scale factor `GL_c_SCALE', added to the
15424 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15425 `glPixelTransfer').
15428 Each element is a single green component. The GL converts it to
15429 floating point and assembles it into an RGBA element by attaching 0
15430 for red and blue, and 1 for alpha. Each component is then
15431 multiplied by the signed scale factor `GL_c_SCALE', added to the
15432 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15433 `glPixelTransfer').
15436 Each element is a single blue component. The GL converts it to
15437 floating point and assembles it into an RGBA element by attaching 0
15438 for red and green, and 1 for alpha. Each component is then
15439 multiplied by the signed scale factor `GL_c_SCALE', added to the
15440 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15441 `glPixelTransfer').
15444 Each element is a single alpha component. The GL converts it to
15445 floating point and assembles it into an RGBA element by attaching 0
15446 for red, green, and blue. Each component is then multiplied by the
15447 signed scale factor `GL_c_SCALE', added to the signed bias
15448 `GL_c_BIAS', and clamped to the range [0,1] (see
15449 `glPixelTransfer').
15452 Each element is a single intensity value. The GL converts it to
15453 floating point, then assembles it into an RGBA element by
15454 replicating the intensity value three times for red, green, blue,
15455 and alpha. Each component is then multiplied by the signed scale
15456 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
15457 clamped to the range [0,1] (see `glPixelTransfer').
15461 Each element is an RGB triple. The GL converts it to floating point
15462 and assembles it into an RGBA element by attaching 1 for alpha.
15463 Each component is then multiplied by the signed scale factor
15464 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15465 the range [0,1] (see `glPixelTransfer').
15469 Each element contains all four components. Each component is
15470 multiplied by the signed scale factor `GL_c_SCALE', added to the
15471 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15472 `glPixelTransfer').
15475 Each element is a single luminance value. The GL converts it to
15476 floating point, then assembles it into an RGBA element by
15477 replicating the luminance value three times for red, green, and
15478 blue and attaching 1 for alpha. Each component is then multiplied
15479 by the signed scale factor `GL_c_SCALE', added to the signed bias
15480 `GL_c_BIAS', and clamped to the range [0,1] (see
15481 `glPixelTransfer').
15483 `GL_LUMINANCE_ALPHA'
15484 Each element is a luminance/alpha pair. The GL converts it to
15485 floating point, then assembles it into an RGBA element by
15486 replicating the luminance value three times for red, green, and
15487 blue. Each component is then multiplied by the signed scale factor
15488 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15489 the range [0,1] (see `glPixelTransfer').
15491 `GL_DEPTH_COMPONENT'
15492 Each element is a single depth value. The GL converts it to
15493 floating point, multiplies by the signed scale factor
15494 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
15495 to the range [0,1] (see `glPixelTransfer').
15497 Refer to the `glDrawPixels' reference page for a description of the
15498 acceptable values for the TYPE parameter.
15500 If an application wants to store the texture at a certain resolution or
15501 in a certain format, it can request the resolution and format with
15502 INTERNALFORMAT. The GL will choose an internal representation that
15503 closely approximates that requested by INTERNALFORMAT, but it may not
15504 match exactly. (The representations specified by `GL_LUMINANCE',
15505 `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
15506 numeric values 1, 2, 3, and 4 may also be used to specify the above
15509 If the INTERNALFORMAT parameter is one of the generic compressed
15510 formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
15511 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
15512 `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
15513 internal format with the symbolic constant for a specific internal
15514 format and compress the texture before storage. If no corresponding
15515 internal format is available, or the GL can not compress that image for
15516 any reason, the internal format is instead replaced with a corresponding
15517 base internal format.
15519 If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
15520 `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
15521 `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
15522 treated as if the red, green, blue, or luminance components are encoded
15523 in the sRGB color space. Any alpha component is left unchanged. The
15524 conversion from the sRGB encoded component C_S to a linear component C_L
15527 C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
15530 Assume C_S is the sRGB component in the range [0,1].
15532 Use the `GL_PROXY_TEXTURE_1D' target to try out a resolution and format.
15533 The implementation will update and recompute its best match for the
15534 requested storage resolution and format. To then query this state, call
15535 `glGetTexLevelParameter'. If the texture cannot be accommodated, texture
15538 A one-component texture image uses only the red component of the RGBA
15539 color from DATA. A two-component image uses the R and A values. A
15540 three-component image uses the R, G, and B values. A four-component
15541 image uses all of the RGBA components.
15543 Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
15544 during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
15545 \xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
15546 generate a boolean result. See `glTexParameter' for details on texture
15549 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_1D' or
15550 `GL_PROXY_TEXTURE_1D'.
15552 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
15553 constant. Format constants other than `GL_STENCIL_INDEX' are accepted.
15555 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
15557 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
15560 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
15562 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
15563 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
15565 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
15566 one of the accepted resolution and format symbolic constants.
15568 `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
15569 2 + `GL_MAX_TEXTURE_SIZE'.
15571 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
15572 supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
15573 some integer value of N.
15575 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
15577 `GL_INVALID_OPERATION' is generated if TYPE is one of
15578 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15579 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
15582 `GL_INVALID_OPERATION' is generated if TYPE is one of
15583 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15584 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15585 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15586 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
15587 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
15589 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
15590 and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
15591 `GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
15593 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
15594 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15595 `GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
15597 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15598 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
15599 data store is currently mapped.
15601 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15602 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
15603 unpacked from the buffer object such that the memory reads required
15604 would exceed the data store size.
15606 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15607 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
15608 divisible into the number of bytes needed to store in memory a datum
15611 `GL_INVALID_OPERATION' is generated if `glTexImage1D' is executed
15612 between the execution of `glBegin' and the corresponding execution of
15615 (define-gl-procedure
15619 (internalFormat GLint)
15628 "Specify a two-dimensional texture image.
15631 Specifies the target texture. Must be `GL_TEXTURE_2D',
15632 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
15633 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
15634 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
15635 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
15638 Specifies the level-of-detail number. Level 0 is the base image
15639 level. Level N is the Nth mipmap reduction image.
15642 Specifies the number of color components in the texture. Must be 1,
15643 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
15644 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15645 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
15646 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
15647 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
15648 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
15649 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
15650 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
15651 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15652 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15653 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15654 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
15655 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
15656 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
15657 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
15658 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
15659 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
15660 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
15664 Specifies the width of the texture image including the border if
15665 any. If the GL version does not support non-power-of-two sizes,
15666 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
15667 implementations support texture images that are at least 64 texels
15671 Specifies the height of the texture image including the border if
15672 any. If the GL version does not support non-power-of-two sizes,
15673 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
15674 implementations support texture images that are at least 64 texels
15678 Specifies the width of the border. Must be either 0 or 1.
15681 Specifies the format of the pixel data. The following symbolic
15682 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
15683 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
15684 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
15687 Specifies the data type of the pixel data. The following symbolic
15688 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
15689 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
15690 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15691 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
15692 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15693 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15694 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15695 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
15698 Specifies a pointer to the image data in memory.
15700 Texturing maps a portion of a specified texture image onto each
15701 graphical primitive for which texturing is enabled. To enable and
15702 disable two-dimensional texturing, call `glEnable' and `glDisable' with
15703 argument `GL_TEXTURE_2D'. To enable and disable texturing using
15704 cube-mapped texture, call `glEnable' and `glDisable' with argument
15705 `GL_TEXTURE_CUBE_MAP'.
15707 To define texture images, call `glTexImage2D'. The arguments describe
15708 the parameters of the texture image, such as height, width, width of the
15709 border, level-of-detail number (see `glTexParameter'), and number of
15710 color components provided. The last three arguments describe how the
15711 image is represented in memory; they are identical to the pixel formats
15712 used for `glDrawPixels'.
15714 If TARGET is `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP', no
15715 data is read from DATA, but all of the texture image state is
15716 recalculated, checked for consistency, and checked against the
15717 implementation's capabilities. If the implementation cannot handle a
15718 texture of the requested texture size, it sets all of the image state to
15719 0, but does not generate an error (see `glGetError'). To query for an
15720 entire mipmap array, use an image array level greater than or equal to
15723 If TARGET is `GL_TEXTURE_2D', or one of the `GL_TEXTURE_CUBE_MAP'
15724 targets, data is read from DATA as a sequence of signed or unsigned
15725 bytes, shorts, or longs, or single-precision floating-point values,
15726 depending on TYPE. These values are grouped into sets of one, two,
15727 three, or four values, depending on FORMAT, to form elements. If TYPE is
15728 `GL_BITMAP', the data is considered as a string of unsigned bytes (and
15729 FORMAT must be `GL_COLOR_INDEX'). Each data byte is treated as eight
15730 1-bit elements, with bit ordering determined by `GL_UNPACK_LSB_FIRST'
15731 (see `glPixelStore').
15733 If a non-zero named buffer object is bound to the
15734 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
15735 image is specified, DATA is treated as a byte offset into the buffer
15736 object's data store.
15738 The first element corresponds to the lower left corner of the texture
15739 image. Subsequent elements progress left-to-right through the remaining
15740 texels in the lowest row of the texture image, and then in successively
15741 higher rows of the texture image. The final element corresponds to the
15742 upper right corner of the texture image.
15744 FORMAT determines the composition of each element in DATA. It can assume
15745 one of these symbolic values:
15748 Each element is a single value, a color index. The GL converts it
15749 to fixed point (with an unspecified number of zero bits to the
15750 right of the binary point), shifted left or right depending on the
15751 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
15752 (see `glPixelTransfer'). The resulting index is converted to a set
15753 of color components using the `GL_PIXEL_MAP_I_TO_R',
15754 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
15755 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
15758 Each element is a single red component. The GL converts it to
15759 floating point and assembles it into an RGBA element by attaching 0
15760 for green and blue, and 1 for alpha. Each component is then
15761 multiplied by the signed scale factor `GL_c_SCALE', added to the
15762 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15763 `glPixelTransfer').
15766 Each element is a single green component. The GL converts it to
15767 floating point and assembles it into an RGBA element by attaching 0
15768 for red and blue, and 1 for alpha. Each component is then
15769 multiplied by the signed scale factor `GL_c_SCALE', added to the
15770 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15771 `glPixelTransfer').
15774 Each element is a single blue component. The GL converts it to
15775 floating point and assembles it into an RGBA element by attaching 0
15776 for red and green, and 1 for alpha. Each component is then
15777 multiplied by the signed scale factor `GL_c_SCALE', added to the
15778 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15779 `glPixelTransfer').
15782 Each element is a single alpha component. The GL converts it to
15783 floating point and assembles it into an RGBA element by attaching 0
15784 for red, green, and blue. Each component is then multiplied by the
15785 signed scale factor `GL_c_SCALE', added to the signed bias
15786 `GL_c_BIAS', and clamped to the range [0,1] (see
15787 `glPixelTransfer').
15790 Each element is a single intensity value. The GL converts it to
15791 floating point, then assembles it into an RGBA element by
15792 replicating the intensity value three times for red, green, blue,
15793 and alpha. Each component is then multiplied by the signed scale
15794 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
15795 clamped to the range [0,1] (see `glPixelTransfer').
15799 Each element is an RGB triple. The GL converts it to floating point
15800 and assembles it into an RGBA element by attaching 1 for alpha.
15801 Each component is then multiplied by the signed scale factor
15802 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15803 the range [0,1] (see `glPixelTransfer').
15807 Each element contains all four components. Each component is
15808 multiplied by the signed scale factor `GL_c_SCALE', added to the
15809 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15810 `glPixelTransfer').
15813 Each element is a single luminance value. The GL converts it to
15814 floating point, then assembles it into an RGBA element by
15815 replicating the luminance value three times for red, green, and
15816 blue and attaching 1 for alpha. Each component is then multiplied
15817 by the signed scale factor `GL_c_SCALE', added to the signed bias
15818 `GL_c_BIAS', and clamped to the range [0,1] (see
15819 `glPixelTransfer').
15821 `GL_LUMINANCE_ALPHA'
15822 Each element is a luminance/alpha pair. The GL converts it to
15823 floating point, then assembles it into an RGBA element by
15824 replicating the luminance value three times for red, green, and
15825 blue. Each component is then multiplied by the signed scale factor
15826 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15827 the range [0,1] (see `glPixelTransfer').
15829 `GL_DEPTH_COMPONENT'
15830 Each element is a single depth value. The GL converts it to
15831 floating point, multiplies by the signed scale factor
15832 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
15833 to the range [0,1] (see `glPixelTransfer').
15835 Refer to the `glDrawPixels' reference page for a description of the
15836 acceptable values for the TYPE parameter.
15838 If an application wants to store the texture at a certain resolution or
15839 in a certain format, it can request the resolution and format with
15840 INTERNALFORMAT. The GL will choose an internal representation that
15841 closely approximates that requested by INTERNALFORMAT, but it may not
15842 match exactly. (The representations specified by `GL_LUMINANCE',
15843 `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
15844 numeric values 1, 2, 3, and 4 may also be used to specify the above
15847 If the INTERNALFORMAT parameter is one of the generic compressed
15848 formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
15849 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
15850 `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
15851 internal format with the symbolic constant for a specific internal
15852 format and compress the texture before storage. If no corresponding
15853 internal format is available, or the GL can not compress that image for
15854 any reason, the internal format is instead replaced with a corresponding
15855 base internal format.
15857 If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
15858 `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
15859 `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
15860 treated as if the red, green, blue, or luminance components are encoded
15861 in the sRGB color space. Any alpha component is left unchanged. The
15862 conversion from the sRGB encoded component C_S to a linear component C_L
15865 C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
15868 Assume C_S is the sRGB component in the range [0,1].
15870 Use the `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP' target to
15871 try out a resolution and format. The implementation will update and
15872 recompute its best match for the requested storage resolution and
15873 format. To then query this state, call `glGetTexLevelParameter'. If the
15874 texture cannot be accommodated, texture state is set to 0.
15876 A one-component texture image uses only the red component of the RGBA
15877 color extracted from DATA. A two-component image uses the R and A
15878 values. A three-component image uses the R, G, and B values. A
15879 four-component image uses all of the RGBA components.
15881 Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
15882 during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
15883 \xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
15884 generate a boolean result. See `glTexParameter' for details on texture
15887 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
15888 `GL_PROXY_TEXTURE_2D', `GL_PROXY_TEXTURE_CUBE_MAP',
15889 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
15890 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
15891 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
15893 `GL_INVALID_ENUM' is generated if TARGET is one of the six cube map 2D
15894 image targets and the width and height parameters are not equal.
15896 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
15898 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
15901 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
15902 greater than 2 + `GL_MAX_TEXTURE_SIZE'.
15904 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
15906 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
15907 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
15909 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
15910 one of the accepted resolution and format symbolic constants.
15912 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
15913 greater than 2 + `GL_MAX_TEXTURE_SIZE'.
15915 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
15916 supported and the WIDTH or HEIGHT cannot be represented as
15917 2^K+2\u2061(BORDER,) for some integer value of K.
15919 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
15921 `GL_INVALID_OPERATION' is generated if TYPE is one of
15922 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15923 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
15926 `GL_INVALID_OPERATION' is generated if TYPE is one of
15927 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15928 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15929 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15930 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
15931 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
15933 `GL_INVALID_OPERATION' is generated if TARGET is not `GL_TEXTURE_2D' or
15934 `GL_PROXY_TEXTURE_2D' and INTERNALFORMAT is `GL_DEPTH_COMPONENT',
15935 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15936 `GL_DEPTH_COMPONENT32'.
15938 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
15939 and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
15940 `GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
15942 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
15943 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15944 `GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
15946 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15947 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
15948 data store is currently mapped.
15950 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15951 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
15952 unpacked from the buffer object such that the memory reads required
15953 would exceed the data store size.
15955 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15956 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
15957 divisible into the number of bytes needed to store in memory a datum
15960 `GL_INVALID_OPERATION' is generated if `glTexImage2D' is executed
15961 between the execution of `glBegin' and the corresponding execution of
15964 (define-gl-procedure
15968 (internalFormat GLint)
15978 "Specify a three-dimensional texture image.
15981 Specifies the target texture. Must be `GL_TEXTURE_3D' or
15982 `GL_PROXY_TEXTURE_3D'.
15985 Specifies the level-of-detail number. Level 0 is the base image
15986 level. Level N is the N^TH mipmap reduction image.
15989 Specifies the number of color components in the texture. Must be 1,
15990 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
15991 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15992 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
15993 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
15994 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_LUMINANCE',
15995 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
15996 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15997 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15998 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15999 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
16000 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
16001 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
16002 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
16003 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
16004 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
16005 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
16009 Specifies the width of the texture image including the border if
16010 any. If the GL version does not support non-power-of-two sizes,
16011 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
16012 implementations support 3D texture images that are at least 16
16016 Specifies the height of the texture image including the border if
16017 any. If the GL version does not support non-power-of-two sizes,
16018 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
16019 implementations support 3D texture images that are at least 16
16023 Specifies the depth of the texture image including the border if
16024 any. If the GL version does not support non-power-of-two sizes,
16025 this value must be 2^K+2\u2061(BORDER,) for some integer K . All
16026 implementations support 3D texture images that are at least 16
16030 Specifies the width of the border. Must be either 0 or 1.
16033 Specifies the format of the pixel data. The following symbolic
16034 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16035 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16036 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16039 Specifies the data type of the pixel data. The following symbolic
16040 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16041 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16042 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16043 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16044 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16045 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16046 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16047 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16050 Specifies a pointer to the image data in memory.
16052 Texturing maps a portion of a specified texture image onto each
16053 graphical primitive for which texturing is enabled. To enable and
16054 disable three-dimensional texturing, call `glEnable' and `glDisable'
16055 with argument `GL_TEXTURE_3D'.
16057 To define texture images, call `glTexImage3D'. The arguments describe
16058 the parameters of the texture image, such as height, width, depth, width
16059 of the border, level-of-detail number (see `glTexParameter'), and number
16060 of color components provided. The last three arguments describe how the
16061 image is represented in memory; they are identical to the pixel formats
16062 used for `glDrawPixels'.
16064 If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
16065 of the texture image state is recalculated, checked for consistency, and
16066 checked against the implementation's capabilities. If the implementation
16067 cannot handle a texture of the requested texture size, it sets all of
16068 the image state to 0, but does not generate an error (see `glGetError').
16069 To query for an entire mipmap array, use an image array level greater
16070 than or equal to 1.
16072 If TARGET is `GL_TEXTURE_3D', data is read from DATA as a sequence of
16073 signed or unsigned bytes, shorts, or longs, or single-precision
16074 floating-point values, depending on TYPE. These values are grouped into
16075 sets of one, two, three, or four values, depending on FORMAT, to form
16076 elements. If TYPE is `GL_BITMAP', the data is considered as a string of
16077 unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
16078 treated as eight 1-bit elements, with bit ordering determined by
16079 `GL_UNPACK_LSB_FIRST' (see `glPixelStore').
16081 If a non-zero named buffer object is bound to the
16082 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16083 image is specified, DATA is treated as a byte offset into the buffer
16084 object's data store.
16086 The first element corresponds to the lower left corner of the texture
16087 image. Subsequent elements progress left-to-right through the remaining
16088 texels in the lowest row of the texture image, and then in successively
16089 higher rows of the texture image. The final element corresponds to the
16090 upper right corner of the texture image.
16092 FORMAT determines the composition of each element in DATA. It can assume
16093 one of these symbolic values:
16096 Each element is a single value, a color index. The GL converts it
16097 to fixed point (with an unspecified number of zero bits to the
16098 right of the binary point), shifted left or right depending on the
16099 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
16100 (see `glPixelTransfer'). The resulting index is converted to a set
16101 of color components using the `GL_PIXEL_MAP_I_TO_R',
16102 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
16103 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
16106 Each element is a single red component. The GL converts it to
16107 floating point and assembles it into an RGBA element by attaching 0
16108 for green and blue, and 1 for alpha. Each component is then
16109 multiplied by the signed scale factor `GL_c_SCALE', added to the
16110 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16111 `glPixelTransfer').
16114 Each element is a single green component. The GL converts it to
16115 floating point and assembles it into an RGBA element by attaching 0
16116 for red and blue, and 1 for alpha. Each component is then
16117 multiplied by the signed scale factor `GL_c_SCALE', added to the
16118 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16119 `glPixelTransfer').
16122 Each element is a single blue component. The GL converts it to
16123 floating point and assembles it into an RGBA element by attaching 0
16124 for red and green, and 1 for alpha. Each component is then
16125 multiplied by the signed scale factor `GL_c_SCALE', added to the
16126 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16127 `glPixelTransfer').
16130 Each element is a single alpha component. The GL converts it to
16131 floating point and assembles it into an RGBA element by attaching 0
16132 for red, green, and blue. Each component is then multiplied by the
16133 signed scale factor `GL_c_SCALE', added to the signed bias
16134 `GL_c_BIAS', and clamped to the range [0,1] (see
16135 `glPixelTransfer').
16138 Each element is a single intensity value. The GL converts it to
16139 floating point, then assembles it into an RGBA element by
16140 replicating the intensity value three times for red, green, blue,
16141 and alpha. Each component is then multiplied by the signed scale
16142 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
16143 clamped to the range [0,1] (see `glPixelTransfer').
16147 Each element is an RGB triple. The GL converts it to floating point
16148 and assembles it into an RGBA element by attaching 1 for alpha.
16149 Each component is then multiplied by the signed scale factor
16150 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
16151 the range [0,1] (see `glPixelTransfer').
16155 Each element contains all four components. Each component is
16156 multiplied by the signed scale factor `GL_c_SCALE', added to the
16157 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16158 `glPixelTransfer').
16161 Each element is a single luminance value. The GL converts it to
16162 floating point, then assembles it into an RGBA element by
16163 replicating the luminance value three times for red, green, and
16164 blue and attaching 1 for alpha. Each component is then multiplied
16165 by the signed scale factor `GL_c_SCALE', added to the signed bias
16166 `GL_c_BIAS', and clamped to the range [0,1] (see
16167 `glPixelTransfer').
16169 `GL_LUMINANCE_ALPHA'
16170 Each element is a luminance/alpha pair. The GL converts it to
16171 floating point, then assembles it into an RGBA element by
16172 replicating the luminance value three times for red, green, and
16173 blue. Each component is then multiplied by the signed scale factor
16174 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
16175 the range [0,1] (see `glPixelTransfer').
16177 Refer to the `glDrawPixels' reference page for a description of the
16178 acceptable values for the TYPE parameter.
16180 If an application wants to store the texture at a certain resolution or
16181 in a certain format, it can request the resolution and format with
16182 INTERNALFORMAT. The GL will choose an internal representation that
16183 closely approximates that requested by INTERNALFORMAT, but it may not
16184 match exactly. (The representations specified by `GL_LUMINANCE',
16185 `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
16186 numeric values 1, 2, 3, and 4 may also be used to specify the above
16189 If the INTERNALFORMAT parameter is one of the generic compressed
16190 formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
16191 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
16192 `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
16193 internal format with the symbolic constant for a specific internal
16194 format and compress the texture before storage. If no corresponding
16195 internal format is available, or the GL can not compress that image for
16196 any reason, the internal format is instead replaced with a corresponding
16197 base internal format.
16199 If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
16200 `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
16201 `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
16202 treated as if the red, green, blue, or luminance components are encoded
16203 in the sRGB color space. Any alpha component is left unchanged. The
16204 conversion from the sRGB encoded component C_S to a linear component C_L
16207 C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
16210 Assume C_S is the sRGB component in the range [0,1].
16212 Use the `GL_PROXY_TEXTURE_3D' target to try out a resolution and format.
16213 The implementation will update and recompute its best match for the
16214 requested storage resolution and format. To then query this state, call
16215 `glGetTexLevelParameter'. If the texture cannot be accommodated, texture
16218 A one-component texture image uses only the red component of the RGBA
16219 color extracted from DATA. A two-component image uses the R and A
16220 values. A three-component image uses the R, G, and B values. A
16221 four-component image uses all of the RGBA components.
16223 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_3D' or
16224 `GL_PROXY_TEXTURE_3D'.
16226 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16227 constant. Format constants other than `GL_STENCIL_INDEX' and
16228 `GL_DEPTH_COMPONENT' are accepted.
16230 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16232 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16235 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16237 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
16238 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16240 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
16241 one of the accepted resolution and format symbolic constants.
16243 `GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
16244 0 or greater than 2 + `GL_MAX_TEXTURE_SIZE'.
16246 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
16247 supported and the WIDTH, HEIGHT, or DEPTH cannot be represented as
16248 2^K+2\u2061(BORDER,) for some integer value of K.
16250 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
16252 `GL_INVALID_OPERATION' is generated if TYPE is one of
16253 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16254 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16257 `GL_INVALID_OPERATION' is generated if TYPE is one of
16258 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16259 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16260 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16261 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16262 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16264 `GL_INVALID_OPERATION' is generated if FORMAT or INTERNALFORMAT is
16265 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
16266 `GL_DEPTH_COMPONENT32'.
16268 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16269 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16270 data store is currently mapped.
16272 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16273 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16274 unpacked from the buffer object such that the memory reads required
16275 would exceed the data store size.
16277 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16278 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16279 divisible into the number of bytes needed to store in memory a datum
16282 `GL_INVALID_OPERATION' is generated if `glTexImage3D' is executed
16283 between the execution of `glBegin' and the corresponding execution of
16286 (define-gl-procedure
16299 "Set texture parameters.
16302 Specifies the target texture, which must be either `GL_TEXTURE_1D',
16303 `GL_TEXTURE_2D', `GL_TEXTURE_3D', or `GL_TEXTURE_CUBE_MAP'.
16306 Specifies the symbolic name of a single-valued texture parameter.
16307 PNAME can be one of the following: `GL_TEXTURE_MIN_FILTER',
16308 `GL_TEXTURE_MAG_FILTER', `GL_TEXTURE_MIN_LOD',
16309 `GL_TEXTURE_MAX_LOD', `GL_TEXTURE_BASE_LEVEL',
16310 `GL_TEXTURE_MAX_LEVEL', `GL_TEXTURE_WRAP_S', `GL_TEXTURE_WRAP_T',
16311 `GL_TEXTURE_WRAP_R', `GL_TEXTURE_PRIORITY',
16312 `GL_TEXTURE_COMPARE_MODE', `GL_TEXTURE_COMPARE_FUNC',
16313 `GL_DEPTH_TEXTURE_MODE', or `GL_GENERATE_MIPMAP'.
16316 Specifies the value of PNAME.
16318 Texture mapping is a technique that applies an image onto an object's
16319 surface as if the image were a decal or cellophane shrink-wrap. The
16320 image is created in texture space, with an (S , T ) coordinate system. A
16321 texture is a one- or two-dimensional image and a set of parameters that
16322 determine how samples are derived from the image.
16324 `glTexParameter' assigns the value or values in PARAMS to the texture
16325 parameter specified as PNAME. TARGET defines the target texture, either
16326 `GL_TEXTURE_1D', `GL_TEXTURE_2D', or `GL_TEXTURE_3D'. The following
16327 symbols are accepted in PNAME:
16329 `GL_TEXTURE_MIN_FILTER'
16330 The texture minifying function is used whenever the pixel being
16331 textured maps to an area greater than one texture element. There
16332 are six defined minifying functions. Two of them use the nearest
16333 one or nearest four texture elements to compute the texture value.
16334 The other four use mipmaps.
16336 A mipmap is an ordered set of arrays representing the same image at
16337 progressively lower resolutions. If the texture has dimensions
16338 2^N×2^M , there are MAX\u2061(N,M)+1 mipmaps. The first mipmap is the
16339 original texture, with dimensions 2^N×2^M . Each subsequent mipmap
16340 has dimensions 2^K-1,×2^L-1, , where 2^K×2^L are the dimensions of
16341 the previous mipmap, until either K=0 or L=0 . At that point,
16342 subsequent mipmaps have dimension 1×2^L-1, or 2^K-1,×1 until the
16343 final mipmap, which has dimension 1×1 . To define the mipmaps, call
16344 `glTexImage1D', `glTexImage2D', `glTexImage3D', `glCopyTexImage1D',
16345 or `glCopyTexImage2D' with the LEVEL argument indicating the order
16346 of the mipmaps. Level 0 is the original texture; level MAX\u2061(N,M) is
16347 the final 1×1 mipmap.
16349 PARAMS supplies a function for minifying the texture as one of the
16352 As more texture elements are sampled in the minification process,
16353 fewer aliasing artifacts will be apparent. While the `GL_NEAREST'
16354 and `GL_LINEAR' minification functions can be faster than the other
16355 four, they sample only one or four texture elements to determine
16356 the texture value of the pixel being rendered and can produce moire
16357 patterns or ragged transitions. The initial value of
16358 `GL_TEXTURE_MIN_FILTER' is `GL_NEAREST_MIPMAP_LINEAR'.
16360 `GL_TEXTURE_MAG_FILTER'
16361 The texture magnification function is used when the pixel being
16362 textured maps to an area less than or equal to one texture element.
16363 It sets the texture magnification function to either `GL_NEAREST'
16364 or `GL_LINEAR' (see below). `GL_NEAREST' is generally faster than
16365 `GL_LINEAR', but it can produce textured images with sharper edges
16366 because the transition between texture elements is not as smooth.
16367 The initial value of `GL_TEXTURE_MAG_FILTER' is `GL_LINEAR'.
16370 Returns the value of the texture element that is nearest (in
16371 Manhattan distance) to the center of the pixel being textured.
16374 Returns the weighted average of the four texture elements that are
16375 closest to the center of the pixel being textured. These can
16376 include border texture elements, depending on the values of
16377 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
16380 `GL_NEAREST_MIPMAP_NEAREST'
16381 Chooses the mipmap that most closely matches the size of the pixel
16382 being textured and uses the `GL_NEAREST' criterion (the texture
16383 element nearest to the center of the pixel) to produce a texture
16386 `GL_LINEAR_MIPMAP_NEAREST'
16387 Chooses the mipmap that most closely matches the size of the pixel
16388 being textured and uses the `GL_LINEAR' criterion (a weighted
16389 average of the four texture elements that are closest to the center
16390 of the pixel) to produce a texture value.
16392 `GL_NEAREST_MIPMAP_LINEAR'
16393 Chooses the two mipmaps that most closely match the size of the
16394 pixel being textured and uses the `GL_NEAREST' criterion (the
16395 texture element nearest to the center of the pixel) to produce a
16396 texture value from each mipmap. The final texture value is a
16397 weighted average of those two values.
16399 `GL_LINEAR_MIPMAP_LINEAR'
16400 Chooses the two mipmaps that most closely match the size of the
16401 pixel being textured and uses the `GL_LINEAR' criterion (a weighted
16402 average of the four texture elements that are closest to the center
16403 of the pixel) to produce a texture value from each mipmap. The
16404 final texture value is a weighted average of those two values.
16407 Returns the value of the texture element that is nearest (in
16408 Manhattan distance) to the center of the pixel being textured.
16411 Returns the weighted average of the four texture elements that are
16412 closest to the center of the pixel being textured. These can
16413 include border texture elements, depending on the values of
16414 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
16419 `GL_TEXTURE_MIN_LOD'
16420 Sets the minimum level-of-detail parameter. This floating-point
16421 value limits the selection of highest resolution mipmap (lowest
16422 mipmap level). The initial value is -1000.
16426 `GL_TEXTURE_MAX_LOD'
16427 Sets the maximum level-of-detail parameter. This floating-point
16428 value limits the selection of the lowest resolution mipmap (highest
16429 mipmap level). The initial value is 1000.
16433 `GL_TEXTURE_BASE_LEVEL'
16434 Specifies the index of the lowest defined mipmap level. This is an
16435 integer value. The initial value is 0.
16439 `GL_TEXTURE_MAX_LEVEL'
16440 Sets the index of the highest defined mipmap level. This is an
16441 integer value. The initial value is 1000.
16445 `GL_TEXTURE_WRAP_S'
16446 Sets the wrap parameter for texture coordinate S to either
16447 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16448 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. `GL_CLAMP' causes S
16449 coordinates to be clamped to the range [0,1] and is useful for
16450 preventing wrapping artifacts when mapping a single image onto an
16451 object. `GL_CLAMP_TO_BORDER' causes the S coordinate to be clamped
16452 to the range [-1/2N,,1+1/2N,] , where N is the size of the texture
16453 in the direction of clamping.`GL_CLAMP_TO_EDGE' causes S
16454 coordinates to be clamped to the range [1/2N,,1-1/2N,] , where N is
16455 the size of the texture in the direction of clamping. `GL_REPEAT'
16456 causes the integer part of the S coordinate to be ignored; the GL
16457 uses only the fractional part, thereby creating a repeating
16458 pattern. `GL_MIRRORED_REPEAT' causes the S coordinate to be set to
16459 the fractional part of the texture coordinate if the integer part
16460 of S is even; if the integer part of S is odd, then the S texture
16461 coordinate is set to 1-FRAC\u2061(S,) , where FRAC\u2061(S,) represents the
16462 fractional part of S . Border texture elements are accessed only if
16463 wrapping is set to `GL_CLAMP' or `GL_CLAMP_TO_BORDER'. Initially,
16464 `GL_TEXTURE_WRAP_S' is set to `GL_REPEAT'.
16468 `GL_TEXTURE_WRAP_T'
16469 Sets the wrap parameter for texture coordinate T to either
16470 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16471 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
16472 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_T' is set to
16475 `GL_TEXTURE_WRAP_R'
16476 Sets the wrap parameter for texture coordinate R to either
16477 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16478 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
16479 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_R' is set to
16482 `GL_TEXTURE_BORDER_COLOR'
16483 Sets a border color. PARAMS contains four values that comprise the
16484 RGBA color of the texture border. Integer color components are
16485 interpreted linearly such that the most positive integer maps to
16486 1.0, and the most negative integer maps to -1.0. The values are
16487 clamped to the range [0,1] when they are specified. Initially, the
16488 border color is (0, 0, 0, 0).
16490 `GL_TEXTURE_PRIORITY'
16491 Specifies the texture residence priority of the currently bound
16492 texture. Permissible values are in the range [0,1] . See
16493 `glPrioritizeTextures' and `glBindTexture' for more information.
16495 `GL_TEXTURE_COMPARE_MODE'
16496 Specifies the texture comparison mode for currently bound depth
16497 textures. That is, a texture whose internal format is
16498 `GL_DEPTH_COMPONENT_*'; see `glTexImage2D') Permissible values are:
16500 `GL_TEXTURE_COMPARE_FUNC'
16501 Specifies the comparison operator used when
16502 `GL_TEXTURE_COMPARE_MODE' is set to `GL_COMPARE_R_TO_TEXTURE'.
16503 Permissible values are: where R is the current interpolated texture
16504 coordinate, and D_T is the depth texture value sampled from the
16505 currently bound depth texture. RESULT is assigned to the either the
16506 luminance, intensity, or alpha (as specified by
16507 `GL_DEPTH_TEXTURE_MODE'.)
16509 `GL_DEPTH_TEXTURE_MODE'
16510 Specifies a single symbolic constant indicating how depth values
16511 should be treated during filtering and texture application.
16512 Accepted values are `GL_LUMINANCE', `GL_INTENSITY', and `GL_ALPHA'.
16513 The initial value is `GL_LUMINANCE'.
16515 `GL_GENERATE_MIPMAP'
16516 Specifies a boolean value that indicates if all levels of a mipmap
16517 array should be automatically updated when any modification to the
16518 base level mipmap is done. The initial value is `GL_FALSE'.
16520 `GL_COMPARE_R_TO_TEXTURE'
16521 Specifies that the interpolated and clamped R texture coordinate
16522 should be compared to the value in the currently bound depth
16523 texture. See the discussion of `GL_TEXTURE_COMPARE_FUNC' for
16524 details of how the comparison is evaluated. The result of the
16525 comparison is assigned to luminance, intensity, or alpha (as
16526 specified by `GL_DEPTH_TEXTURE_MODE').
16529 Specifies that the luminance, intensity, or alpha (as specified by
16530 `GL_DEPTH_TEXTURE_MODE') should be assigned the appropriate value
16531 from the currently bound depth texture.
16533 *Texture Comparison Function*
16537 RESULT={(1.0), (0.0)\u2062\xa0(R<=D_T,), (R>D_T,),
16540 RESULT={(1.0), (0.0)\u2062\xa0(R>=D_T,), (R<D_T,),
16543 RESULT={(1.0), (0.0)\u2062\xa0(R<D_T,), (R>=D_T,),
16546 RESULT={(1.0), (0.0)\u2062\xa0(R>D_T,), (R<=D_T,),
16549 RESULT={(1.0), (0.0)\u2062\xa0(R=D_T,), (R≠D_T,),
16552 RESULT={(1.0), (0.0)\u2062\xa0(R≠D_T,), (R=D_T,),
16560 `GL_INVALID_ENUM' is generated if TARGET or PNAME is not one of the
16561 accepted defined values.
16563 `GL_INVALID_ENUM' is generated if PARAMS should have a defined constant
16564 value (based on the value of PNAME) and does not.
16566 `GL_INVALID_OPERATION' is generated if `glTexParameter' is executed
16567 between the execution of `glBegin' and the corresponding execution of
16570 (define-gl-procedure
16581 "Specify a one-dimensional texture subimage.
16584 Specifies the target texture. Must be `GL_TEXTURE_1D'.
16587 Specifies the level-of-detail number. Level 0 is the base image
16588 level. Level N is the Nth mipmap reduction image.
16591 Specifies a texel offset in the x direction within the texture
16595 Specifies the width of the texture subimage.
16598 Specifies the format of the pixel data. The following symbolic
16599 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16600 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16601 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16604 Specifies the data type of the pixel data. The following symbolic
16605 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16606 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16607 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16608 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16609 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16610 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16611 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16612 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16615 Specifies a pointer to the image data in memory.
16617 Texturing maps a portion of a specified texture image onto each
16618 graphical primitive for which texturing is enabled. To enable or disable
16619 one-dimensional texturing, call `glEnable' and `glDisable' with argument
16622 `glTexSubImage1D' redefines a contiguous subregion of an existing
16623 one-dimensional texture image. The texels referenced by DATA replace the
16624 portion of the existing texture array with x indices XOFFSET and
16625 XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
16626 outside the range of the texture array as it was originally specified.
16627 It is not an error to specify a subtexture with width of 0, but such a
16628 specification has no effect.
16630 If a non-zero named buffer object is bound to the
16631 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16632 image is specified, DATA is treated as a byte offset into the buffer
16633 object's data store.
16635 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
16638 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16641 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16643 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16646 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16648 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16649 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16651 `GL_INVALID_VALUE' is generated if XOFFSET<-B , or if
16652 (XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH', and B is
16653 the width of the `GL_TEXTURE_BORDER' of the texture image being
16654 modified. Note that W includes twice the border width.
16656 `GL_INVALID_VALUE' is generated if WIDTH is less than 0.
16658 `GL_INVALID_OPERATION' is generated if the texture array has not been
16659 defined by a previous `glTexImage1D' operation.
16661 `GL_INVALID_OPERATION' is generated if TYPE is one of
16662 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16663 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16666 `GL_INVALID_OPERATION' is generated if TYPE is one of
16667 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16668 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16669 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16670 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16671 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16673 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16674 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16675 data store is currently mapped.
16677 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16678 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16679 unpacked from the buffer object such that the memory reads required
16680 would exceed the data store size.
16682 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16683 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16684 divisible into the number of bytes needed to store in memory a datum
16687 `GL_INVALID_OPERATION' is generated if `glTexSubImage1D' is executed
16688 between the execution of `glBegin' and the corresponding execution of
16691 (define-gl-procedure
16704 "Specify a two-dimensional texture subimage.
16707 Specifies the target texture. Must be `GL_TEXTURE_2D',
16708 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
16709 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
16710 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
16711 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
16714 Specifies the level-of-detail number. Level 0 is the base image
16715 level. Level N is the Nth mipmap reduction image.
16718 Specifies a texel offset in the x direction within the texture
16722 Specifies a texel offset in the y direction within the texture
16726 Specifies the width of the texture subimage.
16729 Specifies the height of the texture subimage.
16732 Specifies the format of the pixel data. The following symbolic
16733 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16734 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16735 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16738 Specifies the data type of the pixel data. The following symbolic
16739 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16740 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16741 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16742 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16743 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16744 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16745 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16746 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16749 Specifies a pointer to the image data in memory.
16751 Texturing maps a portion of a specified texture image onto each
16752 graphical primitive for which texturing is enabled. To enable and
16753 disable two-dimensional texturing, call `glEnable' and `glDisable' with
16754 argument `GL_TEXTURE_2D'.
16756 `glTexSubImage2D' redefines a contiguous subregion of an existing
16757 two-dimensional texture image. The texels referenced by DATA replace the
16758 portion of the existing texture array with x indices XOFFSET and
16759 XOFFSET+WIDTH-1 , inclusive, and y indices YOFFSET and YOFFSET+HEIGHT-1
16760 , inclusive. This region may not include any texels outside the range of
16761 the texture array as it was originally specified. It is not an error to
16762 specify a subtexture with zero width or height, but such a specification
16765 If a non-zero named buffer object is bound to the
16766 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16767 image is specified, DATA is treated as a byte offset into the buffer
16768 object's data store.
16770 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
16771 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
16772 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
16773 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
16775 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16778 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16780 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16783 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16785 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16786 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16788 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
16789 , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
16790 `GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the border
16791 width of the texture image being modified. Note that W and H include
16792 twice the border width.
16794 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0.
16796 `GL_INVALID_OPERATION' is generated if the texture array has not been
16797 defined by a previous `glTexImage2D' operation.
16799 `GL_INVALID_OPERATION' is generated if TYPE is one of
16800 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16801 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16804 `GL_INVALID_OPERATION' is generated if TYPE is one of
16805 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16806 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16807 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16808 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16809 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16811 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16812 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16813 data store is currently mapped.
16815 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16816 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16817 unpacked from the buffer object such that the memory reads required
16818 would exceed the data store size.
16820 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16821 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16822 divisible into the number of bytes needed to store in memory a datum
16825 `GL_INVALID_OPERATION' is generated if `glTexSubImage2D' is executed
16826 between the execution of `glBegin' and the corresponding execution of
16829 (define-gl-procedure
16844 "Specify a three-dimensional texture subimage.
16847 Specifies the target texture. Must be `GL_TEXTURE_3D'.
16850 Specifies the level-of-detail number. Level 0 is the base image
16851 level. Level N is the Nth mipmap reduction image.
16854 Specifies a texel offset in the x direction within the texture
16858 Specifies a texel offset in the y direction within the texture
16862 Specifies a texel offset in the z direction within the texture
16866 Specifies the width of the texture subimage.
16869 Specifies the height of the texture subimage.
16872 Specifies the depth of the texture subimage.
16875 Specifies the format of the pixel data. The following symbolic
16876 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16877 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16878 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16881 Specifies the data type of the pixel data. The following symbolic
16882 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16883 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16884 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16885 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16886 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16887 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16888 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16889 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16892 Specifies a pointer to the image data in memory.
16894 Texturing maps a portion of a specified texture image onto each
16895 graphical primitive for which texturing is enabled. To enable and
16896 disable three-dimensional texturing, call `glEnable' and `glDisable'
16897 with argument `GL_TEXTURE_3D'.
16899 `glTexSubImage3D' redefines a contiguous subregion of an existing
16900 three-dimensional texture image. The texels referenced by DATA replace
16901 the portion of the existing texture array with x indices XOFFSET and
16902 XOFFSET+WIDTH-1 , inclusive, y indices YOFFSET and YOFFSET+HEIGHT-1 ,
16903 inclusive, and z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This
16904 region may not include any texels outside the range of the texture array
16905 as it was originally specified. It is not an error to specify a
16906 subtexture with zero width, height, or depth but such a specification
16909 If a non-zero named buffer object is bound to the
16910 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16911 image is specified, DATA is treated as a byte offset into the buffer
16912 object's data store.
16914 `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
16916 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16919 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16921 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16924 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16926 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16927 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16929 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
16930 , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , or ZOFFSET<-B , or
16931 (ZOFFSET+DEPTH,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
16932 `GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH' and B is the border
16933 width of the texture image being modified. Note that W , H , and D
16934 include twice the border width.
16936 `GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
16939 `GL_INVALID_OPERATION' is generated if the texture array has not been
16940 defined by a previous `glTexImage3D' operation.
16942 `GL_INVALID_OPERATION' is generated if TYPE is one of
16943 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16944 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16947 `GL_INVALID_OPERATION' is generated if TYPE is one of
16948 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16949 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16950 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16951 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16952 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16954 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16955 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16956 data store is currently mapped.
16958 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16959 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16960 unpacked from the buffer object such that the memory reads required
16961 would exceed the data store size.
16963 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16964 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16965 divisible into the number of bytes needed to store in memory a datum
16968 `GL_INVALID_OPERATION' is generated if `glTexSubImage3D' is executed
16969 between the execution of `glBegin' and the corresponding execution of
16972 (define-gl-procedure
16979 "Multiply the current matrix by a translation matrix.
16986 Specify the X, Y, and Z coordinates of a translation vector.
16988 `glTranslate' produces a translation by (X,YZ) . The current matrix (see
16989 `glMatrixMode') is multiplied by this translation matrix, with the
16990 product replacing the current matrix, as if `glMultMatrix' were called
16991 with the following matrix for its argument:
16993 ((1 0 0 X), (0 1 0 Y), (0 0 1 Z), (0 0 0 1),)
16997 If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
16998 objects drawn after a call to `glTranslate' are translated.
17000 Use `glPushMatrix' and `glPopMatrix' to save and restore the
17001 untranslated coordinate system.
17003 `GL_INVALID_OPERATION' is generated if `glTranslate' is executed between
17004 the execution of `glBegin' and the corresponding execution of `glEnd'.")
17006 (define-gl-procedure
17033 (glUniform1i (location GLint) (v0 GLint) -> void)
17055 "Specify the value of a uniform variable for the current program object.
17058 Specifies the location of the uniform variable to be modified.
17061 Specifies the new values to be used for the specified uniform
17064 `glUniform' modifies the value of a uniform variable or a uniform
17065 variable array. The location of the uniform variable to be modified is
17066 specified by LOCATION, which should be a value returned by
17067 `glGetUniformLocation'. `glUniform' operates on the program object that
17068 was made part of current state by calling `glUseProgram'.
17070 The commands `glUniform{1|2|3|4}{f|i}' are used to change the value of
17071 the uniform variable specified by LOCATION using the values passed as
17072 arguments. The number specified in the command should match the number
17073 of components in the data type of the specified uniform variable (e.g.,
17074 `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The suffix
17075 `f' indicates that floating-point values are being passed; the suffix
17076 `i' indicates that integer values are being passed, and this type should
17077 also match the data type of the specified uniform variable. The `i'
17078 variants of this function should be used to provide values for uniform
17079 variables defined as int, ivec2, ivec3, ivec4, or arrays of these. The
17080 `f' variants should be used to provide values for uniform variables of
17081 type float, vec2, vec3, vec4, or arrays of these. Either the `i' or the
17082 `f' variants may be used to provide values for uniform variables of type
17083 bool, bvec2, bvec3, bvec4, or arrays of these. The uniform variable will
17084 be set to false if the input value is 0 or 0.0f, and it will be set to
17087 All active uniform variables defined in a program object are initialized
17088 to 0 when the program object is linked successfully. They retain the
17089 values assigned to them by a call to `glUniform ' until the next
17090 successful link operation occurs on the program object, when they are
17091 once again initialized to 0.
17093 The commands `glUniform{1|2|3|4}{f|i}v' can be used to modify a single
17094 uniform variable or a uniform variable array. These commands pass a
17095 count and a pointer to the values to be loaded into a uniform variable
17096 or a uniform variable array. A count of 1 should be used if modifying
17097 the value of a single uniform variable, and a count of 1 or greater can
17098 be used to modify an entire array or part of an array. When loading N
17099 elements starting at an arbitrary position M in a uniform variable
17100 array, elements M + N - 1 in the array will be replaced with the new
17101 values. If M + N - 1 is larger than the size of the uniform variable
17102 array, values for all array elements beyond the end of the array will be
17103 ignored. The number specified in the name of the command indicates the
17104 number of components for each element in VALUE, and it should match the
17105 number of components in the data type of the specified uniform variable
17106 (e.g., `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The
17107 data type specified in the name of the command must match the data type
17108 for the specified uniform variable as described previously for
17109 `glUniform{1|2|3|4}{f|i}'.
17111 For uniform variable arrays, each element of the array is considered to
17112 be of the type indicated in the name of the command (e.g., `glUniform3f'
17113 or `glUniform3fv' can be used to load a uniform variable array of type
17114 vec3). The number of elements of the uniform variable array to be
17115 modified is specified by COUNT
17117 The commands `glUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv' are used
17118 to modify a matrix or an array of matrices. The numbers in the command
17119 name are interpreted as the dimensionality of the matrix. The number `2'
17120 indicates a 2 × 2 matrix (i.e., 4 values), the number `3' indicates a 3
17121 × 3 matrix (i.e., 9 values), and the number `4' indicates a 4 × 4 matrix
17122 (i.e., 16 values). Non-square matrix dimensionality is explicit, with
17123 the first number representing the number of columns and the second
17124 number representing the number of rows. For example, `2x4' indicates a 2
17125 × 4 matrix with 2 columns and 4 rows (i.e., 8 values). If TRANSPOSE is
17126 `GL_FALSE', each matrix is assumed to be supplied in column major order.
17127 If TRANSPOSE is `GL_TRUE', each matrix is assumed to be supplied in row
17128 major order. The COUNT argument indicates the number of matrices to be
17129 passed. A count of 1 should be used if modifying the value of a single
17130 matrix, and a count greater than 1 can be used to modify an array of
17133 `GL_INVALID_OPERATION' is generated if there is no current program
17136 `GL_INVALID_OPERATION' is generated if the size of the uniform variable
17137 declared in the shader does not match the size indicated by the
17138 `glUniform' command.
17140 `GL_INVALID_OPERATION' is generated if one of the integer variants of
17141 this function is used to load a uniform variable of type float, vec2,
17142 vec3, vec4, or an array of these, or if one of the floating-point
17143 variants of this function is used to load a uniform variable of type
17144 int, ivec2, ivec3, or ivec4, or an array of these.
17146 `GL_INVALID_OPERATION' is generated if LOCATION is an invalid uniform
17147 location for the current program object and LOCATION is not equal to -1.
17149 `GL_INVALID_VALUE' is generated if COUNT is less than 0.
17151 `GL_INVALID_OPERATION' is generated if COUNT is greater than 1 and the
17152 indicated uniform variable is not an array variable.
17154 `GL_INVALID_OPERATION' is generated if a sampler is loaded using a
17155 command other than `glUniform1i' and `glUniform1iv'.
17157 `GL_INVALID_OPERATION' is generated if `glUniform' is executed between
17158 the execution of `glBegin' and the corresponding execution of `glEnd'.")
17160 (define-gl-procedure
17161 ((glUseProgram (program GLuint) -> void))
17162 "Installs a program object as part of current rendering state.
17165 Specifies the handle of the program object whose executables are to
17166 be used as part of current rendering state.
17168 `glUseProgram' installs the program object specified by PROGRAM as part
17169 of current rendering state. One or more executables are created in a
17170 program object by successfully attaching shader objects to it with
17171 `glAttachShader', successfully compiling the shader objects with
17172 `glCompileShader', and successfully linking the program object with
17175 A program object will contain an executable that will run on the vertex
17176 processor if it contains one or more shader objects of type
17177 `GL_VERTEX_SHADER' that have been successfully compiled and linked.
17178 Similarly, a program object will contain an executable that will run on
17179 the fragment processor if it contains one or more shader objects of type
17180 `GL_FRAGMENT_SHADER' that have been successfully compiled and linked.
17182 Successfully installing an executable on a programmable processor will
17183 cause the corresponding fixed functionality of OpenGL to be disabled.
17184 Specifically, if an executable is installed on the vertex processor, the
17185 OpenGL fixed functionality will be disabled as follows.
17187 * The projection matrix is not applied to vertex coordinates.
17189 * The texture matrices are not applied to texture coordinates.
17191 * Normals are not transformed to eye coordinates.
17193 * Normals are not rescaled or normalized.
17195 * Normalization of `GL_AUTO_NORMAL' evaluated normals is not
17198 * Texture coordinates are not generated automatically.
17200 * Per-vertex lighting is not performed.
17202 * Color material computations are not performed.
17204 * Color index lighting is not performed.
17206 * This list also applies when setting the current raster position.
17208 The executable that is installed on the vertex processor is expected to
17209 implement any or all of the desired functionality from the preceding
17210 list. Similarly, if an executable is installed on the fragment
17211 processor, the OpenGL fixed functionality will be disabled as follows.
17213 * Texture application is not applied.
17215 * Color sum is not applied.
17217 * Fog is not applied.
17219 Again, the fragment shader that is installed is expected to implement
17220 any or all of the desired functionality from the preceding list.
17222 While a program object is in use, applications are free to modify
17223 attached shader objects, compile attached shader objects, attach
17224 additional shader objects, and detach or delete shader objects. None of
17225 these operations will affect the executables that are part of the
17226 current state. However, relinking the program object that is currently
17227 in use will install the program object as part of the current rendering
17228 state if the link operation was successful (see `glLinkProgram' ). If
17229 the program object currently in use is relinked unsuccessfully, its link
17230 status will be set to `GL_FALSE', but the executables and associated
17231 state will remain part of the current state until a subsequent call to
17232 `glUseProgram' removes it from use. After it is removed from use, it
17233 cannot be made part of current state until it has been successfully
17236 If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but it
17237 does not contain shader objects of type `GL_FRAGMENT_SHADER', an
17238 executable will be installed on the vertex processor, but fixed
17239 functionality will be used for fragment processing. Similarly, if
17240 PROGRAM contains shader objects of type `GL_FRAGMENT_SHADER' but it does
17241 not contain shader objects of type `GL_VERTEX_SHADER', an executable
17242 will be installed on the fragment processor, but fixed functionality
17243 will be used for vertex processing. If PROGRAM is 0, the programmable
17244 processors will be disabled, and fixed functionality will be used for
17245 both vertex and fragment processing.
17247 `GL_INVALID_VALUE' is generated if PROGRAM is neither 0 nor a value
17248 generated by OpenGL.
17250 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
17252 `GL_INVALID_OPERATION' is generated if PROGRAM could not be made part of
17255 `GL_INVALID_OPERATION' is generated if `glUseProgram' is executed
17256 between the execution of `glBegin' and the corresponding execution of
17259 (define-gl-procedure
17260 ((glValidateProgram (program GLuint) -> void))
17261 "Validates a program object.
17264 Specifies the handle of the program object to be validated.
17266 `glValidateProgram' checks to see whether the executables contained in
17267 PROGRAM can execute given the current OpenGL state. The information
17268 generated by the validation process will be stored in PROGRAM's
17269 information log. The validation information may consist of an empty
17270 string, or it may be a string containing information about how the
17271 current program object interacts with the rest of current OpenGL state.
17272 This provides a way for OpenGL implementers to convey more information
17273 about why the current program is inefficient, suboptimal, failing to
17274 execute, and so on.
17276 The status of the validation operation will be stored as part of the
17277 program object's state. This value will be set to `GL_TRUE' if the
17278 validation succeeded, and `GL_FALSE' otherwise. It can be queried by
17279 calling `glGetProgram' with arguments PROGRAM and `GL_VALIDATE_STATUS'.
17280 If validation is successful, PROGRAM is guaranteed to execute given the
17281 current state. Otherwise, PROGRAM is guaranteed to not execute.
17283 This function is typically useful only during application development.
17284 The informational string stored in the information log is completely
17285 implementation dependent; therefore, an application should not expect
17286 different OpenGL implementations to produce identical information
17289 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
17292 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
17294 `GL_INVALID_OPERATION' is generated if `glValidateProgram' is executed
17295 between the execution of `glBegin' and the corresponding execution of
17298 (define-gl-procedure
17299 ((glVertexAttribPointer
17303 (normalized GLboolean)
17308 "Define an array of generic vertex attribute data.
17311 Specifies the index of the generic vertex attribute to be modified.
17314 Specifies the number of components per generic vertex attribute.
17315 Must be 1, 2, 3, or 4. The initial value is 4.
17318 Specifies the data type of each component in the array. Symbolic
17319 constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
17320 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
17321 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
17324 Specifies whether fixed-point data values should be normalized
17325 (`GL_TRUE') or converted directly as fixed-point values
17326 (`GL_FALSE') when they are accessed.
17329 Specifies the byte offset between consecutive generic vertex
17330 attributes. If STRIDE is 0, the generic vertex attributes are
17331 understood to be tightly packed in the array. The initial value is
17335 Specifies a pointer to the first component of the first generic
17336 vertex attribute in the array. The initial value is 0.
17338 `glVertexAttribPointer' specifies the location and data format of the
17339 array of generic vertex attributes at index INDEX to use when rendering.
17340 SIZE specifies the number of components per attribute and must be 1, 2,
17341 3, or 4. TYPE specifies the data type of each component, and STRIDE
17342 specifies the byte stride from one attribute to the next, allowing
17343 vertices and attributes to be packed into a single array or stored in
17344 separate arrays. If set to `GL_TRUE', NORMALIZED indicates that values
17345 stored in an integer format are to be mapped to the range [-1,1] (for
17346 signed values) or [0,1] (for unsigned values) when they are accessed and
17347 converted to floating point. Otherwise, values will be converted to
17348 floats directly without normalization.
17350 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
17351 target (see `glBindBuffer') while a generic vertex attribute array is
17352 specified, POINTER is treated as a byte offset into the buffer object's
17353 data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
17354 is saved as generic vertex attribute array client-side state
17355 (`GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING') for index INDEX.
17357 When a generic vertex attribute array is specified, SIZE, TYPE,
17358 NORMALIZED, STRIDE, and POINTER are saved as client-side state, in
17359 addition to the current vertex array buffer object binding.
17361 To enable and disable a generic vertex attribute array, call
17362 `glEnableVertexAttribArray' and `glDisableVertexAttribArray' with INDEX.
17363 If enabled, the generic vertex attribute array is used when
17364 `glArrayElement', `glDrawArrays', `glMultiDrawArrays', `glDrawElements',
17365 `glMultiDrawElements', or `glDrawRangeElements' is called.
17367 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
17368 `GL_MAX_VERTEX_ATTRIBS'.
17370 `GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
17372 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
17374 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
17376 (define-gl-procedure
17429 (glVertexAttrib4Nub
17437 "Specifies the value of a generic vertex attribute.
17440 Specifies the index of the generic vertex attribute to be modified.
17443 Specifies the new values to be used for the specified vertex
17446 OpenGL defines a number of standard vertex attributes that applications
17447 can modify with standard API entry points (color, normal, texture
17448 coordinates, etc.). The `glVertexAttrib' family of entry points allows
17449 an application to pass generic vertex attributes in numbered locations.
17451 Generic attributes are defined as four-component values that are
17452 organized into an array. The first entry of this array is numbered 0,
17453 and the size of the array is specified by the implementation-dependent
17454 constant `GL_MAX_VERTEX_ATTRIBS'. Individual elements of this array can
17455 be modified with a `glVertexAttrib' call that specifies the index of the
17456 element to be modified and a value for that element.
17458 These commands can be used to specify one, two, three, or all four
17459 components of the generic vertex attribute specified by INDEX. A `1' in
17460 the name of the command indicates that only one value is passed, and it
17461 will be used to modify the first component of the generic vertex
17462 attribute. The second and third components will be set to 0, and the
17463 fourth component will be set to 1. Similarly, a `2' in the name of the
17464 command indicates that values are provided for the first two components,
17465 the third component will be set to 0, and the fourth component will be
17466 set to 1. A `3' in the name of the command indicates that values are
17467 provided for the first three components and the fourth component will be
17468 set to 1, whereas a `4' in the name indicates that values are provided
17469 for all four components.
17471 The letters `s', `f', `i', `d', `ub', `us', and `ui' indicate whether
17472 the arguments are of type short, float, int, double, unsigned byte,
17473 unsigned short, or unsigned int. When `v' is appended to the name, the
17474 commands can take a pointer to an array of such values. The commands
17475 containing `N' indicate that the arguments will be passed as fixed-point
17476 values that are scaled to a normalized range according to the component
17477 conversion rules defined by the OpenGL specification. Signed values are
17478 understood to represent fixed-point values in the range [-1,1], and
17479 unsigned values are understood to represent fixed-point values in the
17482 OpenGL Shading Language attribute variables are allowed to be of type
17483 mat2, mat3, or mat4. Attributes of these types may be loaded using the
17484 `glVertexAttrib' entry points. Matrices must be loaded into successive
17485 generic attribute slots in column major order, with one column of the
17486 matrix in each generic attribute slot.
17488 A user-defined attribute variable declared in a vertex shader can be
17489 bound to a generic attribute index by calling `glBindAttribLocation'.
17490 This allows an application to use more descriptive variable names in a
17491 vertex shader. A subsequent change to the specified generic vertex
17492 attribute will be immediately reflected as a change to the corresponding
17493 attribute variable in the vertex shader.
17495 The binding between a generic vertex attribute index and a user-defined
17496 attribute variable in a vertex shader is part of the state of a program
17497 object, but the current value of the generic vertex attribute is not.
17498 The value of each generic vertex attribute is part of current state,
17499 just like standard vertex attributes, and it is maintained even if a
17500 different program object is used.
17502 An application may freely modify generic vertex attributes that are not
17503 bound to a named vertex shader attribute variable. These values are
17504 simply maintained as part of current state and will not be accessed by
17505 the vertex shader. If a generic vertex attribute bound to an attribute
17506 variable in a vertex shader is not updated while the vertex shader is
17507 executing, the vertex shader will repeatedly use the current value for
17508 the generic vertex attribute.
17510 The generic vertex attribute with index 0 is the same as the vertex
17511 position attribute previously defined by OpenGL. A `glVertex2',
17512 `glVertex3', or `glVertex4' command is completely equivalent to the
17513 corresponding `glVertexAttrib' command with an index argument of 0. A
17514 vertex shader can access generic vertex attribute 0 by using the
17515 built-in attribute variable GL_VERTEX. There are no current values for
17516 generic vertex attribute 0. This is the only generic vertex attribute
17517 with this property; calls to set other standard vertex attributes can be
17518 freely mixed with calls to set any of the other generic vertex
17521 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
17522 `GL_MAX_VERTEX_ATTRIBS'.")
17524 (define-gl-procedure
17532 "Define an array of vertex data.
17535 Specifies the number of coordinates per vertex. Must be 2, 3, or 4.
17536 The initial value is 4.
17539 Specifies the data type of each coordinate in the array. Symbolic
17540 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
17541 accepted. The initial value is `GL_FLOAT'.
17544 Specifies the byte offset between consecutive vertices. If STRIDE
17545 is 0, the vertices are understood to be tightly packed in the
17546 array. The initial value is 0.
17549 Specifies a pointer to the first coordinate of the first vertex in
17550 the array. The initial value is 0.
17552 `glVertexPointer' specifies the location and data format of an array of
17553 vertex coordinates to use when rendering. SIZE specifies the number of
17554 coordinates per vertex, and must be 2, 3, or 4. TYPE specifies the data
17555 type of each coordinate, and STRIDE specifies the byte stride from one
17556 vertex to the next, allowing vertices and attributes to be packed into a
17557 single array or stored in separate arrays. (Single-array storage may be
17558 more efficient on some implementations; see `glInterleavedArrays'.)
17560 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
17561 target (see `glBindBuffer') while a vertex array is specified, POINTER
17562 is treated as a byte offset into the buffer object's data store. Also,
17563 the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as vertex
17564 array client-side state (`GL_VERTEX_ARRAY_BUFFER_BINDING').
17566 When a vertex array is specified, SIZE, TYPE, STRIDE, and POINTER are
17567 saved as client-side state, in addition to the current vertex array
17568 buffer object binding.
17570 To enable and disable the vertex array, call `glEnableClientState' and
17571 `glDisableClientState' with the argument `GL_VERTEX_ARRAY'. If enabled,
17572 the vertex array is used when `glArrayElement', `glDrawArrays',
17573 `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements', or
17574 `glDrawRangeElements' is called.
17576 `GL_INVALID_VALUE' is generated if SIZE is not 2, 3, or 4.
17578 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
17580 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
17582 (define-gl-procedure
17583 ((glVertex2i (x GLint) (y GLint) -> void)
17584 (glVertex2d (x GLdouble) (y GLdouble) -> void)
17620 Specify X, Y, Z, and W coordinates of a vertex. Not all parameters
17621 are present in all forms of the command.
17623 `glVertex' commands are used within `glBegin'/`glEnd' pairs to specify
17624 point, line, and polygon vertices. The current color, normal, texture
17625 coordinates, and fog coordinate are associated with the vertex when
17626 `glVertex' is called.
17628 When only X and Y are specified, Z defaults to 0 and W defaults to 1.
17629 When X , Y , and Z are specified, W defaults to 1.")
17631 (define-gl-procedure
17644 Specify the lower left corner of the viewport rectangle, in pixels.
17645 The initial value is (0,0).
17650 Specify the width and height of the viewport. When a GL context is
17651 first attached to a window, WIDTH and HEIGHT are set to the
17652 dimensions of that window.
17654 `glViewport' specifies the affine transformation of X and Y from
17655 normalized device coordinates to window coordinates. Let (X_ND,Y_ND) be
17656 normalized device coordinates. Then the window coordinates (X_W,Y_W) are
17657 computed as follows:
17659 X_W=(X_ND+1,)\u2062(WIDTH/2,)+X
17661 Y_W=(Y_ND+1,)\u2062(HEIGHT/2,)+Y
17663 Viewport width and height are silently clamped to a range that depends
17664 on the implementation. To query this range, call `glGet' with argument
17665 `GL_MAX_VIEWPORT_DIMS'.
17667 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
17669 `GL_INVALID_OPERATION' is generated if `glViewport' is executed between
17670 the execution of `glBegin' and the corresponding execution of `glEnd'.")
17672 (define-gl-procedure
17673 ((glWindowPos2i (x GLint) (y GLint) -> void)
17674 (glWindowPos2d (x GLdouble) (y GLdouble) -> void)
17687 "Specify the raster position in window coordinates for pixel operations.
17694 Specify the X , Y , Z coordinates for the raster position.
17696 The GL maintains a 3D position in window coordinates. This position,
17697 called the raster position, is used to position pixel and bitmap write
17698 operations. It is maintained with subpixel accuracy. See `glBitmap',
17699 `glDrawPixels', and `glCopyPixels'.
17701 `glWindowPos2' specifies the X and Y coordinates, while Z is implicitly
17702 set to 0. `glWindowPos3' specifies all three coordinates. The W
17703 coordinate of the current raster position is always set to 1.0.
17705 `glWindowPos' directly updates the X and Y coordinates of the current
17706 raster position with the values specified. That is, the values are
17707 neither transformed by the current modelview and projection matrices,
17708 nor by the viewport-to-window transform. The Z coordinate of the current
17709 raster position is updated in the following manner:
17711 Z={(N), (F), (N+Z×(F-N,),)\u2062(IF\u2062Z<=0), (IF\u2062Z>=1), (`otherwise',),
17715 where N is `GL_DEPTH_RANGE''s near value, and F is `GL_DEPTH_RANGE''s
17716 far value. See `glDepthRange'.
17718 The specified coordinates are not clip-tested, causing the raster
17719 position to always be valid.
17721 The current raster position also includes some associated color data and
17722 texture coordinates. If lighting is enabled, then
17723 `GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
17724 (in color index mode) is set to the color produced by the lighting
17725 calculation (see `glLight', `glLightModel', and `glShadeModel'). If
17726 lighting is disabled, current color (in RGBA mode, state variable
17727 `GL_CURRENT_COLOR') or color index (in color index mode, state variable
17728 `GL_CURRENT_INDEX') is used to update the current raster color.
17729 `GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
17731 Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
17732 `GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
17733 generation functions (see `glTexGen'). The `GL_CURRENT_RASTER_DISTANCE'
17734 is set to the `GL_CURRENT_FOG_COORD'.
17738 `GL_INVALID_OPERATION' is generated if `glWindowPos' is executed between
17739 the execution of `glBegin' and the corresponding execution of `glEnd'.")