GL_GEQUAL

Passes if the incoming depth value is greater than or equal to the stored depth value.

GL_ALWAYS

Always passes.

The initial value of func is GL_LESS. Initially, depth testing is disabled.

Notes

Even if the depth buffer exists and the depth mask is nonzero, the depth buffer is not updated if the depth test is disabled.

Errors

GL_INVALID_ENUM is generated if func is not an accepted value.

GL_INVALID_OPERATION is generated if glDepthFunc is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGet with argument GL_DEPTH_FUNC

glIsEnabled with argument GL_DEPTH_TEST

See Also

glDepthRange, glEnable, glPolygonOffset

glDepthMask

Enable or disable writing into the depth buffer

C Specification

void glDepthMask(GLboolean flag);

Parameters

Image

Description

glDepthMask specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE, depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer writing is enabled.

Errors

GL_INVALID_OPERATION is generated if glDepthMask is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGet with argument GL_DEPTH_WRITEMASK

See Also

glColorMask, glDepthFunc, glDepthRange, glIndexMask, glStencilMask

glDepthRange

Specify mapping of depth values from normalized device coordinates to window coordinates

C Specification

void glDepthRange(GLclampd nearVal,
                                   GLclampd farVal);

Parameters

Image

Description

After clipping and division by w, depth coordinates range from -1 to 1, corresponding to the near and far clipping planes. glDepthRange specifies a linear mapping of the normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0 through 1 (like color components). Thus, the values accepted by glDepthRange are both clamped to this range before they are accepted.

The setting of (0,1) maps the near plane to 0 and the far plane to 1. With this mapping, the depth buffer range is fully utilized.

Notes

It is not necessary that nearVal be less than farVal. Reverse mappings such as nearVal = 1, and farVal = 0 are acceptable.

Errors

GL_INVALID_OPERATION is generated if glDepthRange is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGet with argument GL_DEPTH_RANGE

See Also

glDepthFunc, glPolygonOffset, glViewport

glDetachShader

Detach a shader object from a program object to which it is attached

C Specification

void glDetachShader(GLuint program,
                                     GLuint shader);

Parameters

Image

Description

glDetachShader detaches the shader object specified by shader from the program object specified by program. This command can be used to undo the effect of the command glAttachShader.

If shader has already been flagged for deletion by a call to glDeleteShader and it is not attached to any other program object, it will be deleted after it has been detached.

Notes

glDetachShader is available only if the GL version is 2.0 or greater.

Errors

GL_INVALID_VALUE is generated if either program or shader is a value that was not generated by OpenGL.

GL_INVALID_OPERATION is generated if program is not a program object.

GL_INVALID_OPERATION is generated if shader is not a shader object.

GL_INVALID_OPERATION is generated if shader is not attached to program.

GL_INVALID_OPERATION is generated if glDetachShader is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGetAttachedShaders with the handle of a valid program object

glGetShader with arguments shader and GL_DELETE_STATUS

glIsProgram

glIsShader

See Also

glAttachShader

glDrawArrays

Render primitives from array data

C Specification

void glDrawArrays(GLenum  mode,
                                   GLint   first,
                                   GLsizei count);

Parameters

Image

Description

glDrawArrays specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and colors and use them to construct a sequence of primitives with a single call to glDrawArrays.

When glDrawArrays is called, it uses count sequential elements from each enabled array to construct a sequence of geometric primitives, beginning with element first. mode specifies what kind of primitives are constructed and how the array elements construct those primitives. If GL_VERTEX_ARRAY is not enabled, no geometric primitives are generated.

Vertex attributes that are modified by glDrawArrays have an unspecified value after glDrawArrays returns. For example, if GL_COLOR_ARRAY is enabled, the value of the current color is undefined after glDrawArrays executes. Attributes that aren’t modified remain well defined.

Notes

glDrawArrays is available only if the GL version is 1.1 or greater.

glDrawArrays is included in display lists. If glDrawArrays is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client-side state, their values affect display lists when the lists are created, not when the lists are executed.

Errors

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_VALUE is generated if count is negative.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to an enabled array and the buffer object’s data store is currently mapped.

GL_INVALID_OPERATION is generated if glDrawArrays is executed between the execution of glBegin and the corresponding glEnd.

See Also

glArrayElement, glColorPointer, glDrawElements, glDrawRangeElements, glEdgeFlagPointer, glFogCoordPointer, glGetPointerv, glIndexPointer, glInterleavedArrays, glNormalPointer, glSecondaryColorPointer, glTexCoordPointer, glVertexPointer

glDrawBuffer

Specify which color buffers are to be drawn into

C Specification

void glDrawBuffer(GLenum mode);

Parameters

Image

Description

When colors are written to the frame buffer, they are written into the color buffers specified by glDrawBuffer. The specifications are as follows:

GL_NONE

No color buffers are written.

GL_FRONT_LEFT

Only the front left color buffer is written.

GL_FRONT_RIGHT

Only the front right color buffer is written.

GL_BACK_LEFT

Only the back left color buffer is written.

GL_BACK_RIGHT

Only the back right color buffer is written.

GL_FRONT

Only the front left and front right color buffers are written. If there is no front right color buffer, only the front left color buffer is written.

GL_BACK

Only the back left and back right color buffers are written. If there is no back right color buffer, only the back left color buffer is written.

GL_LEFT

Only the front left and back left color buffers are written. If there is no back left color buffer, only the front left color buffer is written.

GL_RIGHT

Only the front right and back right color buffers are written. If there is no back right color buffer, only the front right color buffer is written.

GL_FRONT_AND_BACK

All the front and back color buffers (front left, front right, back left, back right) are written. If there are no back color buffers, only the front left and front right color buffers are written. If there are no right color buffers, only the front left and back left color buffers are written. If there are no right or back color buffers, only the front left color buffer is written.

GL_AUXi

Only auxiliary color buffer i is written.

If more than one color buffer is selected for drawing, then blending or logical operations are computed and applied independently for each color buffer and can produce different results in each buffer.

Monoscopic contexts include only left buffers, and stereoscopic contexts include both left and right buffers. Likewise, single-buffered contexts include only front buffers, and double-buffered contexts include both front and back buffers. The context is selected at GL initialization.

Notes

It is always the case that GL_AUXi = GL_AUX0 + i.

Errors

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_OPERATION is generated if none of the buffers indicated by mode exists. GL_INVALID_OPERATION is generated if glDrawBuffer is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGet with argument GL_DRAW_BUFFER

glGet with argument GL_AUX_BUFFERS

See Also

glBlendFunc, glColorMask, glIndexMask, glLogicOp, glReadBuffer

glDrawBuffers

Specify a list of color buffers to be drawn into

C Specification

void glDrawBuffers(GLsizei        n,
                                    const GLenum * bufs);

Parameters

Image

Description

glDrawBuffers defines an array of buffers into which fragment color values or fragment data will be written. If no fragment shader is active, rendering operations will generate only one fragment color per fragment and it will be written into each of the buffers specified by bufs. If a fragment shader is active and it writes a value to the output variable gl_FragColor, then that value will be written into each of the buffers specified by bufs. If a fragment shader is active and it writes a value to one or more elements of the output array variable gl_FragData[], then the value of gl_FragData[0] will be written into the first buffer specified by bufs, the value of gl_FragData[1] will be written into the second buffer specified by bufs, and so on up to gl_FragData[n-1]. The draw buffer used for gl_FragData[n] and beyond is implicitly set to be GL_NONE.

The symbolic constants contained in bufs may be any of the following:

GL_NONE

The fragment color/data value is not written into any color buffer.

GL_FRONT_LEFT

The fragment color/data value is written into the front left color buffer.

GL_FRONT_RIGHT

The fragment color/data value is written into the front right color buffer.

GL_BACK_LEFT

The fragment color/data value is written into the back left color buffer.

GL_BACK_RIGHT

The fragment color/data value is written into the back right color buffer.

GL_AUXi

The fragment color/data value is written into auxiliary buffer i.

Except for GL_NONE, the preceding symbolic constants may not appear more than once in bufs. The maximum number of draw buffers supported is implementation dependent and can be queried by calling glGet with the argument GL_MAX_DRAW_BUFFERS. The number of auxiliary buffers can be queried by calling glGet with the argument GL_AUX_BUFFERS.

Notes

glDrawBuffers is available only if the GL version is 2.0 or greater.

It is always the case that GL_AUXi = GL_AUX0 + i.

The symbolic constants GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT, and GL_FRONT_AND_BACK are not allowed in the bufs array since they may refer to multiple buffers.

If a fragment shader writes to neither gl_FragColor nor gl_FragData, the values of the fragment colors following shader execution are undefined. For each fragment generated in this situation, a different value may be written into each of the buffers specified by bufs.

Errors

GL_INVALID_ENUM is generated if one of the values in bufs is not an accepted value.

GL_INVALID_ENUM is generated if n is less than 0.

GL_INVALID_OPERATION is generated if a symbolic constant other than GL_NONE appears more than once in bufs.

GL_INVALID_OPERATION is generated if any of the entries in bufs (other than GL_NONE ) indicates a color buffer that does not exist in the current GL context.

GL_INVALID_VALUE is generated if n is greater than GL_MAX_DRAW_BUFFERS.

GL_INVALID_OPERATION is generated if glDrawBuffers is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGet with argument GL_MAX_DRAW_BUFFERS

glGet with argument GL_DRAW_BUFFERSi where i indicates the number of the draw buffer whose value is to be queried

See Also

glBlendFunc, glColorMask, glDrawBuffers, glIndexMask, glLogicOp, glReadBuffer

glDrawElements

Render primitives from array data

C Specification

void glDrawElements(GLenum         mode,
                                     GLsizei        count,
                                     GLenum         type,
                                     const GLvoid * indices);

Parameters

Image

Description

glDrawElements specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL function to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and so on, and use them to construct a sequence of primitives with a single call to glDrawElements.

When glDrawElements is called, it uses count sequential elements from an enabled array, starting at indices to construct a sequence of geometric primitives. mode specifies what kind of primitives are constructed and how the array elements construct these primitives. If more than one array is enabled, each is used. If GL_VERTEX_ARRAY is not enabled, no geometric primitives are constructed.

Vertex attributes that are modified by glDrawElements have an unspecified value after glDrawElements returns. For example, if GL_COLOR_ARRAY is enabled, the value of the current color is undefined after glDrawElements executes. Attributes that aren’t modified maintain their previous values.

Notes

glDrawElements is available only if the GL version is 1.1 or greater.

glDrawElements is included in display lists. If glDrawElements is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client-side state, their values affect display lists when the lists are created, not when the lists are executed.

Errors

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_VALUE is generated if count is negative.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to an enabled array or the element array and the buffer object’s data store is currently mapped.

GL_INVALID_OPERATION is generated if glDrawElements is executed between the execution of glBegin and the corresponding glEnd.

See Also

glArrayElement, glColorPointer, glDrawArrays, glDrawRangeElements, glEdgeFlagPointer, glFogCoordPointer, glGetPointerv, glIndexPointer, glInterleavedArrays, glNormalPointer, glSecondaryColorPointer, glTexCoordPointer, glVertexPointer

glDrawPixels

Write a block of pixels to the frame buffer

C Specification

void glDrawPixels(GLsizei        width,
                                   GLsizei        height,
                                   GLenum         format,
                                  GLenum         type,
                                   const GLvoid * data);

Parameters

Image

Description

glDrawPixels reads pixel data from memory and writes it into the frame buffer relative to the current raster position, provided that the raster position is valid. Use glRasterPos or glWindowPos to set the current raster position; use glGet with argument GL_CURRENT_RASTER_POSITION_VALID to determine if the specified raster position is valid, and glGet with argument GL_CURRENT_RASTER_POSITION to query the raster position.

Several parameters define the encoding of pixel data in memory and control the processing of the pixel data before it is placed in the frame buffer. These parameters are set with four commands: glPixelStore, glPixelTransfer, glPixelMap, and glPixelZoom. This reference page describes the effects on glDrawPixels of many, but not all, of the parameters specified by these four commands.

Data is read from data as a sequence of signed or unsigned bytes, signed or unsigned shorts, signed or unsigned integers, or single-precision floating-point values, depending on type. When type is one of GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT, each of these bytes, shorts, integers, or floating-point values is interpreted as one color or depth component, or one index, depending on format. When type is one of GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_INT_8_8_8_8, or GL_UNSIGNED_INT_10_10_10_2, each unsigned value is interpreted as containing all the components for a single pixel, with the color components arranged according to format. When type is one of GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8_REV, or GL_UNSIGNED_INT_2_10_10_10_REV, each unsigned value is interpreted as containing all color components, specified by format, for a single pixel in a reversed order. Indices are always treated individually. Color components are treated as groups of one, two, three, or four values, again based on format. Both individual indices and groups of components are referred to as pixels. If type is GL_BITMAP, the data must be unsigned bytes, and format must be either GL_COLOR_INDEX or GL_STENCIL_INDEX. Each unsigned byte is treated as eight 1-bit pixels, with bit ordering determined by GL_UNPACK_LSB_FIRST (see glPixelStore).

width × height pixels are read from memory, starting at location data. By default, these pixels are taken from adjacent memory locations, except that after all width pixels are read, the read pointer is advanced to the next four-byte boundary. The four-byte row alignment is specified by glPixelStore with argument GL_UNPACK_ALIGNMENT, and it can be set to one, two, four, or eight bytes. Other pixel store parameters specify different read pointer advancements, both before the first pixel is read and after all width pixels are read. See the glPixelStore reference page for details on these options.

If a nonzero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER target (see glBindBuffer) while a block of pixels is specified, data is treated as a byte offset into the buffer object’s data store.

The width × height pixels that are read from memory are each operated on in the same way, based on the values of several parameters specified by glPixelTransfer and glPixelMap. The details of these operations, as well as the target buffer into which the pixels are drawn, are specific to the format of the pixels, as specified by format. format can assume one of 13 symbolic values:

GL_COLOR_INDEX

Each pixel is a single value, a color index. It is converted to fixed-point format, with an unspecified number of bits to the right of the binary point, regardless of the memory data type. Floating-point values convert to true fixed-point values. Signed and unsigned integer data is converted with all fraction bits set to 0. Bitmap data convert to either 0 or 1.

Each fixed-point index is then shifted left by GL_INDEX_SHIFT bits and added to GL_INDEX_OFFSET. If GL_INDEX_SHIFT is negative, the shift is to the right. In either case, zero bits fill otherwise unspecified bit locations in the result.

If the GL is in RGBA mode, the resulting index is converted to an RGBA pixel with the help of the GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A tables. If the GL is in color index mode, and if GL_MAP_COLOR is true, the index is replaced with the value that it references in lookup table GL_PIXEL_MAP_I_TO_I. Whether the lookup replacement of the index is done or not, the integer part of the index is then ANDed with 2b – 1, where b is the number of bits in a color index buffer.

The GL then converts the resulting indices or RGBA colors to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that

xn = x r + n % width

Image

where (xr,yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer.

GL_STENCIL_INDEX

Each pixel is a single value, a stencil index. It is converted to fixed-point format, with an unspecified number of bits to the right of the binary point, regardless of the memory data type. Floating-point values convert to true fixed-point values. Signed and unsigned integer data is converted with all fraction bits set to 0. Bitmap data convert to either 0 or 1.

Each fixed-point index is then shifted left by GL_INDEX_SHIFT bits, and added to GL_INDEX_OFFSET. If GL_INDEX_SHIFT is negative, the shift is to the right. In either case, zero bits fill otherwise unspecified bit locations in the result. If GL_MAP_STENCIL is true, the index is replaced with the value that it references in lookup table GL_PIXEL_MAP_S_TO_S. Whether the lookup replacement of the index is done or not, the integer part of the index is then ANDed with 2b – 1, where b is the number of bits in the stencil buffer. The resulting stencil indices are then written to the stencil buffer such that the nth index is written to location

xn = xr + n % width

Image

where (xr,yr) is the current raster position. Only the pixel ownership test, the scissor test, and the stencil writemask affect these write operations.

GL_DEPTH_COMPONENT

Each pixel is a single-depth component. Floating-point data is converted directly to an internal floating-point format with unspecified precision. Signed integer data is mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data is mapped similarly: the largest integer value maps to 1.0, and 0 maps to 0.0. The resulting floating-point depth value is then multiplied by GL_DEPTH_SCALE and added to GL_DEPTH_BIAS. The result is clamped to the range [0,1].

The GL then converts the resulting depth components to fragments by attaching the current raster position color or color index and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that

xn = xr + n % width

Image

where (xr,yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer.

GL_RGBA

GL_BGRA

Each pixel is a four-component group: For GL_RGBA, the red component is first, followed by green, followed by blue, followed by alpha; for GL_BGRA the order is blue, green, red and then alpha. Floating-point values are converted directly to an internal floating-point format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. (Note that this mapping does not convert 0 precisely to 0.0.) Unsigned integer data is mapped similarly: The largest integer value maps to 1.0, and 0 maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. The results are clamped to the range [0,1].

If GL_MAP_COLOR is true, each color component is scaled by the size of lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is R, G, B, or A respectively.

The GL then converts the resulting RGBA colors to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that

xn = xr + n % width

Image

where (xr,yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer.

GL_RED

Each pixel is a single red component. This component is converted to the internal floating-point format in the same way the red component of an RGBA pixel is. It is then converted to an RGBA pixel with green and blue set to 0, and alpha set to 1. After this conversion, the pixel is treated as if it had been read as an RGBA pixel.

GL_GREEN

Each pixel is a single green component. This component is converted to the internal floating-point format in the same way the green component of an RGBA pixel is. It is then converted to an RGBA pixel with red and blue set to 0, and alpha set to 1. After this conversion, the pixel is treated as if it had been read as an RGBA pixel.

GL_BLUE

Each pixel is a single blue component. This component is converted to the internal floating-point format in the same way the blue component of an RGBA pixel is. It is then converted to an RGBA pixel with red and green set to 0, and alpha set to 1. After this conversion, the pixel is treated as if it had been read as an RGBA pixel.

GL_ALPHA

Each pixel is a single alpha component. This component is converted to the internal floating-point format in the same way the alpha component of an RGBA pixel is. It is then converted to an RGBA pixel with red, green, and blue set to 0. After this conversion, the pixel is treated as if it had been read as an RGBA pixel.

GL_RGB

GL_BGR

Each pixel is a three-component group: red first, followed by green, followed by blue; for GL_BGR, the first component is blue, followed by green and then red. Each component is converted to the internal floating-point format in the same way the red, green, and blue components of an RGBA pixel are. The color triple is converted to an RGBA pixel with alpha set to 1. After this conversion, the pixel is treated as if it had been read as an RGBA pixel.

GL_LUMINANCE

Each pixel is a single luminance component. This component is converted to the internal floating-point format in the same way the red component of an RGBA pixel is. It is then converted to an RGBA pixel with red, green, and blue set to the converted luminance value, and alpha set to 1. After this conversion, the pixel is treated as if it had been read as an RGBA pixel.

GL_LUMINANCE_ALPHA

Each pixel is a two-component group: luminance first, followed by alpha. The two components are converted to the internal floating-point format in the same way the red component of an RGBA pixel is. They are then converted to an RGBA pixel with red, green, and blue set to the converted luminance value, and alpha set to the converted alpha value. After this conversion, the pixel is treated as if it had been read as an RGBA pixel. The following table summarizes the meaning of the valid constants for the type parameter:

Image

The rasterization described so far assumes pixel zoom factors of 1. If glPixelZoom is used to change the x and y pixel zoom factors, pixels are converted to fragments as follows. If (xr,yr) is the current raster position, and a given pixel is in the nth column and mth row of the pixel rectangle, then fragments are generated for pixels whose centers are in the rectangle with corners at

(xr + zoomx n,yr + zoomy m)

(xr + zoomx (n + 1),yr + zoomy (m + 1) )

where zoomx is the value of GL_ZOOM_X and zoomy is the value of GL_ZOOM_Y.

Notes

GL_BGR and GL_BGRA are only valid for format if the GL version is 1.2 or greater. GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5,

GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4,

GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1,

GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8,

GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV are only valid for type if the GL version is 1.2 or greater.

Errors

GL_INVALID_ENUM is generated if format or type is not one of the accepted values.

GL_INVALID_ENUM is generated if type is GL_BITMAP and format is not either GL_COLOR_INDEX or GL_STENCIL_INDEX.

GL_INVALID_VALUE is generated if either width or height is negative.

GL_INVALID_OPERATION is generated if format is GL_STENCIL_INDEX and there is no stencil buffer.

GL_INVALID_OPERATION is generated if format is GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_BGR, GL_BGRA, GL_LUMINANCE, or GL_LUMINANCE_ALPHA, and the GL is in color index mode.

GL_INVALID_OPERATION is generated if format is one of GL_UNSIGNED_BYTE_3_3_2,

GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, or

GL_UNSIGNED_SHORT_5_6_5_REV and format is not GL_RGB.

GL_INVALID_OPERATION is generated if format is one of GL_UNSIGNED_SHORT_4_4_4_4,

GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1

GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8,

GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, or

GL_UNSIGNED_INT_2_10_10_10_REV and format is neither GL_RGBA nor GL_BGRA.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to the GL_PIXEL_UNPACK_BUFFER target and the buffer object’s data store is currently mapped.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to the GL_PIXEL_UNPACK_BUFFER target and the data would be unpacked from the buffer object such that the memory reads required would exceed the data store size.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to the GL_PIXEL_UNPACK_BUFFER target and data is not evenly divisible into the number of bytes needed to store in memory a datum indicated by type.

GL_INVALID_OPERATION is generated if glDrawPixels is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGet with argument GL_CURRENT_RASTER_POSITION

glGet with argument GL_CURRENT_RASTER_POSITION_VALID

glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING

See Also

glAlphaFunc, glBlendFunc, glCopyPixels, glDepthFunc, glLogicOp, glPixelMap, glPixelStore, glPixelTransfer, glPixelZoom, glRasterPos, glReadPixels, glScissor, glStencilFunc, glWindowPos

glDrawRangeElements

Render primitives from array data

C Specification

void glDrawRangeElements(GLenum         mode,
                                         GLuint         start,
                                          GLuint         end,
                                          GLsizei        count,
                                          GLenum         type,
                                          const GLvoid * indices);

Parameters

Image

Description

glDrawRangeElements is a restricted form of glDrawElements. mode, start, end, and count match the corresponding arguments to glDrawElements, with the additional constraint that all values in the arrays count must lie between start and end, inclusive.

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling glGet with argument GL_MAX_ELEMENTS_VERTICES and GL_MAX_ELEMENTS_INDICES. If endstart + 1 is greater than the value of GL_MAX_ELEMENTS_VERTICES, or if count is greater than the value of GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices in the range [start,end] be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be achieved with an optimal index set.

When glDrawRangeElements is called, it uses count sequential elements from an enabled array, starting at start to construct a sequence of geometric primitives. mode specifies what kind of primitives are constructed, and how the array elements construct these primitives. If more than one array is enabled, each is used. If GL_VERTEX_ARRAY is not enabled, no geometric primitives are constructed.

Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. For example, if GL_COLOR_ARRAY is enabled, the value of the current color is undefined after glDrawRangeElements executes. Attributes that aren’t modified maintain their previous values.

Notes

glDrawRangeElements is available only if the GL version is 1.2 or greater.

glDrawRangeElements is included in display lists. If glDrawRangeElements is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client-side state, their values affect display lists when the lists are created, not when the lists are executed.

Errors

It is an error for indices to lie outside the range [start,end], but implementations may not check for this situation. Such indices cause implementation-dependent behavior.

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_VALUE is generated if count is negative.

GL_INVALID_VALUE is generated if end< start.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to an enabled array or the element array and the buffer object’s data store is currently mapped.

GL_INVALID_OPERATION is generated if glDrawRangeElements is executed between the execution of glBegin and the corresponding glEnd.

Associated Gets

glGet with argument GL_MAX_ELEMENTS_VERTICES

glGet with argument GL_MAX_ELEMENTS_INDICES

See Also

glArrayElement, glColorPointer, glDrawArrays, glDrawElements, glEdgeFlagPointer, glGetPointerv, glIndexPointer, glInterleavedArrays, glNormalPointer, glSecondaryColorPointer, glTexCoordPointer, glVertexPointer

glEdgeFlag

Flag edges as either boundary or nonboundary

C Specification

void glEdgeFlag(GLboolean flag);

Parameters

Image

C Specification

void glEdgeFlagv(const GLboolean * flag);

Parameters

Image

Description

Each vertex of a polygon, separate triangle, or separate quadrilateral specified between a glBegin/glEnd pair is marked as the start of either a boundary or nonboundary edge. If the current edge flag is true when the vertex is specified, the vertex is marked as the start of a boundary edge. Otherwise, the vertex is marked as the start of a nonboundary edge. glEdgeFlag sets the edge flag bit to GL_TRUE if flag is GL_TRUE and to GL_FALSE otherwise.

The vertices of connected triangles and connected quadrilaterals are always marked as boundary, regardless of the value of the edge flag.

Boundary and nonboundary edge flags on vertices are significant only if GL_POLYGON_MODE is set to GL_POINT or GL_LINE. See glPolygonMode.

Notes

The current edge flag can be updated at any time. In particular, glEdgeFlag can be called between a call to glBegin and the corresponding call to glEnd.

Associated Gets

glGet with argument GL_EDGE_FLAG

See Also

glBegin, glEdgeFlagPointer, glPolygonMode

glEdgeFlagPointer

Define an array of edge flags

C Specification

void glEdgeFlagPointer(GLsizei        stride,
                                        const GLvoid * pointer);

Parameters

Image

Description

glEdgeFlagPointer specifies the location and data format of an array of boolean edge flags to use when rendering. stride specifies the byte stride from one edge flag to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

If a nonzero named buffer object is bound to the GL_ARRAY_BUFFER target (see glBindBuffer) while an edge flag array is specified, pointer is treated as a byte offset into the buffer object’s data store. Also, the buffer object binding (GL_ARRAY_BUFFER_BINDING) is saved as edge flag vertex array client-side state (GL_EDGE_FLAG_ARRAY_BUFFER_BINDING).

When an edge flag array is specified, stride and pointer are saved as client-side state, in addition to the current vertex array buffer object binding.

To enable and disable the edge flag array, call glEnableClientState and glDisableClientState with the argument GL_EDGE_FLAG_ARRAY. If enabled, the edge flag array is used when glDrawArrays, glMultiDrawArrays, glDrawElements, glMultiDrawElements, glDrawRangeElements, or glArrayElement is called.

Notes

glEdgeFlagPointer is available only if the GL version is 1.1 or greater.

Edge flags are not supported for interleaved vertex array formats (see glInterleavedArrays). The edge flag array is initially disabled and isn’t accessed when glArrayElement, glDrawElements, glDrawRangeElements, glDrawArrays, glMultiDrawArrays, or glMultiDrawElements is called.

Execution of glEdgeFlagPointer is not allowed between the execution of glBegin and the corresponding execution of glEnd, but an error may or may not be generated. If no error is generated, the operation is undefined. glEdgeFlagPointer is typically implemented on the client side.

Edge flag array parameters are client-side state and are therefore not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead.

Errors

GL_INVALID_ENUM is generated if stride is negative.

Associated Gets

glIsEnabled with argument GL_EDGE_FLAG_ARRAY

glGet with argument GL_EDGE_FLAG_ARRAY_STRIDE

glGet with argument GL_EDGE_FLAG_ARRAY_BUFFER_BINDING

glGet with argument GL_ARRAY_BUFFER_BINDING

glGetPointerv with argument GL_EDGE_FLAG_ARRAY_POINTER

See Also

glArrayElement, glBindBuffer, glColorPointer, glDisableClientState, glDrawArrays, glDrawElements, glDrawRangeElements, glEdgeFlag, glEnableClientState, glFogCoordPointer, glIndexPointer, glInterleavedArrays, glMultiDrawArrays, glMultiDrawElements, glNormalPointer, glPopClientAttrib, glPushClientAttrib, glSecondaryColorPointer, glTexCoordPointer, glVertexAttribPointer, glVertexPointer

glEnable

Enable or disable server-side GL capabilities

C Specification

void glEnable(GLenum cap);

Parameters

Image

C Specification

void glDisable(GLenum cap);

Parameters

Image

Description

glEnable and glDisable enable and disable various capabilities. Use glIsEnabled or glGet to determine the current setting of any capability. The initial value for each capability with the exception of GL_DITHER is GL_FALSE. The initial value for GL_DITHER is GL_TRUE.

Both glEnable and glDisable take a single argument, cap, which can assume one of the following values:

GL_ALPHA_TEST

If enabled, do alpha testing. See glAlphaFunc.

GL_AUTO_NORMAL

If enabled, generate normal vectors when either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 is used to generate vertices. See glMap2.

GL_BLEND

If enabled, blend the incoming RGBA color values with the values in the color buffers. See glBlendFunc.

GL_CLIP_PLANEi

If enabled, clip geometry against user-defined clipping plane i. See glClipPlane. GL_COLOR_LOGIC_OP

If enabled, apply the currently selected logical operation to the incoming RGBA color and color buffer values. See glLogicOp.

GL_COLOR_MATERIAL

If enabled, have one or more material parameters track the current color. See glColorMaterial.

GL_COLOR_SUM

If enabled, add the secondary color value to the computed fragment color. See glSecondaryColor.

GL_COLOR_TABLE

If enabled, perform a color table lookup on the incoming RGBA color values. See glColorTable.

GL_CONVOLUTION_1D If enabled, perform a 1D convolution operation on incoming RGBA color values. See glConvolutionFilter1D.

GL_CONVOLUTION_2D

If enabled, perform a 2D convolution operation on incoming RGBA color values. See glConvolutionFilter2D.

GL_CULL_FACE

If enabled, cull polygons based on their winding in window coordinates. See glCullFace.

GL_DEPTH_TEST

If enabled, do depth comparisons and update the depth buffer. Note that even if the depth buffer exists and the depth mask is nonzero, the depth buffer is not updated if the depth test is disabled. See glDepthFunc and glDepthRange.

GL_DITHER

If enabled, dither color components or indices before they are written to the color buffer. GL_FOG If enabled, blend a fog color into the post-texturing color. See glFog.

GL_HISTOGRAM

If enabled, histogram incoming RGBA color values. See glHistogram. GL_INDEX_LOGIC_OP

If enabled, apply the currently selected logical operation to the incoming index and color buffer indices. See glLogicOp.

GL_LIGHTi

If enabled, include light i in the evaluation of the lighting equation. See glLightModel and glLight.

GL_LIGHTING

If enabled, use the current lighting parameters to compute the vertex color or index. Otherwise, simply associate the current color or index with each vertex. See glMaterial, glLightModel, and glLight.

GL_LINE_SMOOTH

If enabled, draw lines with correct filtering. Otherwise, draw aliased lines. See glLineWidth.

GL_LINE_STIPPLE

If enabled, use the current line stipple pattern when drawing lines. See glLineStipple.

GL_MAP1_COLOR_4

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate RGBA values.

See glMap1.

GL_MAP1_INDEX

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate color indices. See glMap1.

GL_MAP1_NORMAL

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate normals.

See glMap1.

GL_MAP1_TEXTURE_COORD_1

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate s texture coordinates. See glMap1.

GL_MAP1_TEXTURE_COORD_2

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate s and t texture coordinates. See glMap1.

GL_MAP1_TEXTURE_COORD_3

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate s, t, and r texture coordinates. See glMap1.

GL_MAP1_TEXTURE_COORD_4

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate s, t, r, and q texture coordinates. See glMap1.

GL_MAP1_VERTEX_3

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate x, y, and z vertex coordinates. See glMap1.

GL_MAP1_VERTEX_4

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate homogeneous x, y, z, and w vertex coordinates.

See glMap1.

GL_MAP2_COLOR_4

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate RGBA values. See glMap2.

GL_MAP2_INDEX

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate color indices. See glMap2.

GL_MAP2_NORMAL

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate normals. See glMap2.

GL_MAP2_TEXTURE_COORD_1

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate s texture coordinates. See glMap2.

GL_MAP2_TEXTURE_COORD_2

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate s and t texture coordinates. See glMap2.

GL_MAP2_TEXTURE_COORD_3

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate s, t, and r texture coordinates. See glMap2.

GL_MAP2_TEXTURE_COORD_4

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate s, t, r, and q texture coordinates. See glMap2.

GL_MAP2_VERTEX_3

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate x, y, and z vertex coordinates. See glMap2.

GL_MAP2_VERTEX_4

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate homogeneous x, y, z, and w vertex coordinates. See glMap2.

GL_MINMAX

If enabled, compute the minimum and maximum values of incoming RGBA color values.

See glMinmax.

GL_MULTISAMPLE

If enabled, use multiple fragment samples in computing the final color of a pixel. See glSampleCoverage.

GL_NORMALIZE

If enabled, normal vectors specified with glNormal are scaled to unit length after transformation. See glNormal.

GL_POINT_SMOOTH

If enabled, draw points with proper filtering. Otherwise, draw aliased points. See glPointSize.

GL_POINT_SPRITE

If enabled, calculate texture coordinates for points based on texture environment and point parameter settings. Otherwise texture coordinates are constant across points.

GL_POLYGON_OFFSET_FILL

If enabled, and if the polygon is rendered in GL_FILL mode, an offset is added to depth values of a polygon’s fragments before the depth comparison is performed. See glPolygonOffset.

GL_POLYGON_OFFSET_LINE

If enabled, and if the polygon is rendered in GL_LINE mode, an offset is added to depth values of a polygon’s fragments before the depth comparison is performed. See glPolygonOffset.

GL_POLYGON_OFFSET_POINT

If enabled, an offset is added to depth values of a polygon’s fragments before the depth comparison is performed, if the polygon is rendered in GL_POINT mode. See glPolygonOffset.

GL_POLYGON_SMOOTH

If enabled, draw polygons with proper filtering. Otherwise, draw aliased polygons. For correct antialiased polygons, an alpha buffer is needed and the polygons must be sorted front to back.

GL_POLYGON_STIPPLE

If enabled, use the current polygon stipple pattern when rendering polygons.

See glPolygonStipple.

GL_POST_COLOR_MATRIX_COLOR_TABLE

If enabled, perform a color table lookup on RGBA color values after color matrix transformation.

See glColorTable.

GL_POST_CONVOLUTION_COLOR_TABLE

If enabled, perform a color table lookup on RGBA color values after convolution.

See glColorTable.

GL_RESCALE_NORMAL

If enabled, normal vectors specified with glNormal are scaled to unit length after transformation. See glNormal.

GL_SAMPLE_ALPHA_TO_COVERAGE

If enabled, compute a temporary coverage value where each bit is determined by the alpha value at the corresponding sample location. The temporary coverage value is then ANDed with the fragment coverage value.

GL_SAMPLE_ALPHA_TO_ONE

If enabled, each sample alpha value is replaced by the maximum representable alpha value.

GL_SAMPLE_COVERAGE

If enabled, the fragment’s coverage is ANDed with the temporary coverage value. If GL_SAMPLE_COVERAGE_INVERT is set to GL_TRUE, invert the coverage value. See glSampleCoverage.

GL_SEPARABLE_2D

If enabled, perform a two-dimensional convolution operation using a separable convolution filter on incoming RGBA color values. See glSeparableFilter2D.

GL_SCISSOR_TEST

If enabled, discard fragments that are outside the scissor rectangle. See glScissor.

GL_STENCIL_TEST

If enabled, do stencil testing and update the stencil buffer. See glStencilFunc and glStencilOp.

GL_TEXTURE_1D

If enabled, one-dimensional texturing is performed (unless two- or three-dimensional or cube-mapped texturing is also enabled). See glTexImage1D.

GL_TEXTURE_2D

If enabled, two-dimensional texturing is performed (unless three-dimensional or cube-mapped texturing is also enabled). See glTexImage2D.

GL_TEXTURE_3D

If enabled, three-dimensional texturing is performed (unless cube-mapped texturing is also enabled). See glTexImage3D.

GL_TEXTURE_CUBE_MAP

If enabled, cube-mapped texturing is performed. See glTexImage2D.

GL_TEXTURE_GEN_Q

If enabled, the q texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current q texture coordinate is used. See glTexGen.

GL_TEXTURE_GEN_R

If enabled, the r texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current r texture coordinate is used. See glTexGen.

GL_TEXTURE_GEN_S

If enabled, the s texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current s texture coordinate is used. See glTexGen.

GL_TEXTURE_GEN_T

If enabled, the t texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current t texture coordinate is used. See glTexGen.

GL_VERTEX_PROGRAM_POINT_SIZE

If enabled, and a vertex shader is active, then the derived point size is taken from the (potentially clipped) shader builtin gl_PointSize and clamped to the implementation-dependent point size range.

GL_VERTEX_PROGRAM_TWO_SIDE

If enabled, and a vertex shader is active, it specifies that the GL will choose between front and back colors based on the polygon’s face direction of which the vertex being shaded is a part. It has no effect on points or lines.

Notes

GL_POLYGON_OFFSET_FILL, GL_POLYGON_OFFSET_LINE, GL_POLYGON_OFFSET_POINT, GL_COLOR_LOGIC_OP, and GL_INDEX_LOGIC_OP are available only if the GL version is 1.1 or greater.

GL_RESCALE_NORMAL, and GL_TEXTURE_3D are available only if the GL version is 1.2 or greater.

GL_MULTISAMPLE, GL_SAMPLE_ALPHA_TO_COVERAGE, GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_TEXTURE_CUBE_MAP are available only if the GL version is 1.3 or greater.

GL_POINT_SPRITE, GL_VERTEX_PROGRAM_POINT_SIZE, and GL_VERTEX_PROGRAM_TWO_SIDE is available only if the GL version is 2.0 or greater.

GL_COLOR_TABLE, GL_CONVOLUTION_1D, GL_CONVOLUTION_2D, GL_HISTOGRAM, GL_MINMAX, GL_POST_COLOR_MATRIX_COLOR_TABLE, GL_POST_CONVOLUTION_COLOR_TABLE, and GL_SEPARABLE_2D are available only if ARB_imaging is returned from glGet with an argument of GL_EXTENSIONS.

For OpenGL versions 1.3 and greater, or when ARB_multitexture is supported, GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R, and GL_TEXTURE_GEN_Q enable or disable the respective state for the active texture unit specified with glActiveTexture.

Errors

GL_INVALID_ENUM is generated if cap is not one of the values listed previously.

GL_INVALID_OPERATION is generated if glEnable or glDisable is executed between the execution of glBegin and the corresponding execution of glEnd.

See Also

glActiveTexture, glAlphaFunc, glBlendFunc, glClipPlane, glColorMaterial, glCullFace, glDepthFunc, glDepthRange, glEnableClientState, glFog, glGet, glIsEnabled, glLight, glLightModel, glLineWidth, glLineStipple, glLogicOp, glMap1, glMap2, glMaterial, glNormal, glPointSize, glPolygonMode, glPolygonOffset, glPolygonStipple, glScissor, glStencilFunc, glStencilOp, glTexGen, glTexImage1D, glTexImage2D, glTexImage3D

glEnableClientState

Enable or disable client-side capability

C Specification

void glEnableClientState(GLenum cap);

Parameters

Image

C Specification

void glDisableClientState(GLenum cap);

Parameters

Image

Description

glEnableClientState and glDisableClientState enable or disable individual client-side capabilities. By default, all client-side capabilities are disabled. Both glEnableClientState and glDisableClientState take a single argument, cap, which can assume one of the following values:

GL_COLOR_ARRAY

If enabled, the color array is enabled for writing and used during rendering when glArrayElement, glDrawArrays, glDrawElements, glDrawRangeElementsglMultiDrawArrays, or glMultiDrawElements is called. See glColorPointer.

GL_EDGE_FLAG_ARRAY

If enabled, the edge flag array is enabled for writing and used during rendering when glArrayElement, glDrawArrays, glDrawElements, glDrawRangeElementsglMultiDrawArrays, or glMultiDrawElements is called. See glEdgeFlagPointer.

GL_FOG_COORD_ARRAY

If enabled, the fog coordinate array is enabled for writing and used during rendering when glArrayElement, glDrawArrays, glDrawElements, glDrawRangeElementsglMultiDrawArrays, or glMultiDrawElements is called. See glFogCoordPointer.

GL_INDEX_ARRAY

If enabled, the index array is enabled for writing and used during rendering when glArrayElement, glDrawArrays, glDrawElements, glDrawRangeElementsglMultiDrawArrays, or glMultiDrawElements is called. See glIndexPointer.

GL_NORMAL_ARRAY

If enabled, the normal array is enabled for writing and used during rendering when glArrayElement, glDrawArrays, glDrawElements, glDrawRangeElementsglMultiDrawArrays, or glMultiDrawElements is called. See glNormalPointer.

GL_SECONDARY_COLOR_ARRAY

If enabled, the secondary color array is enabled for writing and used during rendering when glArrayElement, glDrawArrays, glDrawElements, glDrawRangeElementsglMultiDrawArrays, or glMultiDrawElements is called. See glColorPointer.

GL_TEXTURE_COORD_ARRAY

If enabled, the texture coordinate array is enabled for writing and used during rendering when glArrayElement, glDrawArrays, glDrawElements, glDrawRangeElementsglMultiDrawArrays, or glMultiDrawElements is called. See glTexCoordPointer.

GL_VERTEX_ARRAY

If enabled, the vertex array is enabled for writing and used during rendering when glArrayElement, glDrawArrays, glDrawElements, glDrawRangeElementsglMultiDrawArrays, or glMultiDrawElements is called. See glVertexPointer.

Notes

glEnableClientState is available only if the GL version is 1.1 or greater.

GL_FOG_COORD_ARRAY and GL_SECONDARY_COLOR_ARRAY are available only if the GL version is 1.4 or greater.

For OpenGL versions 1.3 and greater, or when ARB_multitexture is supported, enabling and disabling GL_TEXTURE_COORD_ARRAY affects the active client texture unit. The active client texture unit is controlled with glClientActiveTexture.

Errors

GL_INVALID_ENUM is generated if cap is not an accepted value.

glEnableClientState is not allowed between the execution of glBegin and the corresponding glEnd, but an error may or may not be generated. If no error is generated, the behavior is undefined.

See Also

glArrayElement, glClientActiveTexture, glColorPointer, glDrawArrays, glDrawElements, glEdgeFlagPointer, glFogCoordPointer, glEnable, glGetPointerv, glIndexPointer, glInterleavedArrays, glNormalPointer, glSecondaryColorPointer, glTexCoordPointer, glVertexPointer

glEnableVertexAttribArray

Enable or disable a generic vertex attribute array

C Specification

void glEnableVertexAttribArray(GLuint index);
void glDisableVertexAttribArray(GLuint index);

Parameters

Image

Description

glEnableVertexAttribArray enables the generic vertex attribute array specified by index. glDisableVertexAttribArray disables the generic vertex attribute array specified by index. By default, all client-side capabilities are disabled, including all generic vertex attribute arrays. If enabled, the values in the generic vertex attribute array will be accessed and used for rendering when calls are made to vertex array commands such as glDrawArrays, glDrawElements, glDrawRangeElements, glArrayElement, glMultiDrawElements, or glMultiDrawArrays.

Notes

glEnableVertexAttribArray and glDisableVertexAttribArray are available only if the GL version is 2.0 or greater.

Errors

GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.

GL_INVALID_OPERATION is generated if either glEnableVertexAttribArray or glDisableVertexAttribArray is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGet with argument GL_MAX_VERTEX_ATTRIBS

glGetVertexAttrib with arguments index and GL_VERTEX_ATTRIB_ARRAY_ENABLED

glGetVertexAttribPointerv with arguments index and GL_VERTEX_ATTRIB_ARRAY_POINTER

See Also

glArrayElement, glBindAttribLocation, glDrawArrays, glDrawElements, glDrawRangeElements, glMultiDrawElements, glPopClientAttrib, glPushClientAttrib, glVertexAttrib, glVertexAttribPointer

glEvalCoord

Evaluate enabled one- and two-dimensional maps

C Specification

void glEvalCoord1f(GLfloat u);
void glEvalCoord1d(GLdouble u);
void glEvalCoord2f(GLfloat u, GLfloat v);
void glEvalCoord2d(GLdouble u, GLdouble v);

Parameters

Image

C Specification

void glEvalCoord1fv(const GLfloat * u);
void glEvalCoord1dv(const GLdouble * u);
void glEvalCoord2fv(const GLfloat * u);
void glEvalCoord2dv(const GLdouble * u);

Parameters

Image

Description

glEvalCoord1 evaluates enabled one-dimensional maps at argument u. glEvalCoord2 does the same for two-dimensional maps using two domain values, u and v. To define a map, call glMap1 and glMap2; to enable and disable it, call glEnable and glDisable.

When one of the glEvalCoord commands is issued, all currently enabled maps of the indicated dimension are evaluated. Then, for each enabled map, it is as if the corresponding GL command had been issued with the computed value. That is, if GL_MAP1_INDEX or GL_MAP2_INDEX is enabled, a glIndex command is simulated. If GL_MAP1_COLOR_4 or GL_MAP2_COLOR_4 is enabled, a glColor command is simulated. If GL_MAP1_NORMAL or GL_MAP2_NORMAL is enabled, a normal vector is produced, and if any of GL_MAP1_TEXTURE_COORD_1, GL_MAP1_TEXTURE_COORD_2, GL_MAP1_TEXTURE_COORD_3, GL_MAP1_TEXTURE_COORD_4, GL_MAP2_TEXTURE_COORD_1, GL_MAP2_TEXTURE_COORD_2, GL_MAP2_TEXTURE_COORD_3, or GL_MAP2_TEXTURE_COORD_4 is enabled, then an appropriate glTexCoord command is simulated.

For color, color index, normal, and texture coordinates the GL uses evaluated values instead of current values for those evaluations that are enabled, and current values otherwise, However, the evaluated values do not update the current values. Thus, if glVertex commands are interspersed with glEvalCoord commands, the color, normal, and texture coordinates associated with the glVertex commands are not affected by the values generated by the glEvalCoord commands, but only by the most recent glColor, glIndex, glNormal, and glTexCoord commands.

No commands are issued for maps that are not enabled. If more than one texture evaluation is enabled for a particular dimension (for example, GL_MAP2_TEXTURE_COORD_1 and GL_MAP2_TEXTURE_COORD_2), then only the evaluation of the map that produces the larger number of coordinates (in this case, GL_MAP2_TEXTURE_COORD_2) is carried out. GL_MAP1_VERTEX_4 overrides GL_MAP1_VERTEX_3, and GL_MAP2_VERTEX_4 overrides GL_MAP2_VERTEX_3, in the same manner. If neither a three- nor a four-component vertex map is enabled for the specified dimension, the glEvalCoord command is ignored.

If you have enabled automatic normal generation, by calling glEnable with argument GL_AUTO_NORMAL, glEvalCoord2 generates surface normals analytically, regardless of the contents or enabling of the GL_MAP2_NORMAL map. Let

Image

then the generated normal

Image

If automatic normal generation is disabled, the corresponding normal map GL_MAP2_NORMAL, if enabled, is used to produce a normal. If neither automatic normal generation nor a normal map is enabled, no normal is generated for glEvalCoord2 commands.

Associated Gets

glIsEnabled with argument GL_MAP1_VERTEX_3

glIsEnabled with argument GL_MAP1_VERTEX_4

glIsEnabled with argument GL_MAP1_INDEX

glIsEnabled with argument GL_MAP1_COLOR_4

glIsEnabled with argument GL_MAP1_NORMAL

glIsEnabled with argument GL_MAP1_TEXTURE_COORD_1

glIsEnabled with argument GL_MAP1_TEXTURE_COORD_2

glIsEnabled with argument GL_MAP1_TEXTURE_COORD_3

glIsEnabled with argument GL_MAP1_TEXTURE_COORD_4

glIsEnabled with argument GL_MAP2_VERTEX_3

glIsEnabled with argument GL_MAP2_VERTEX_4

glIsEnabled with argument GL_MAP2_INDEX

glIsEnabled with argument GL_MAP2_COLOR_4

glIsEnabled with argument GL_MAP2_NORMAL

glIsEnabled with argument GL_MAP2_TEXTURE_COORD_1

glIsEnabled with argument GL_MAP2_TEXTURE_COORD_2

glIsEnabled with argument GL_MAP2_TEXTURE_COORD_3

glIsEnabled with argument GL_MAP2_TEXTURE_COORD_4

glIsEnabled with argument GL_AUTO_NORMAL

glGetMap

See Also

glBegin, glColor, glEnable, glEvalMesh, glEvalPoint, glIndex, glMap1, glMap2, glMapGrid, glNormal, glTexCoord, glVertex

glEvalMesh

Compute a one- or two-dimensional grid of points or lines

C Specification

void glEvalMesh1(GLenum mode,
                                  GLint i1,
                                  GLint i2);

Parameters

Image

C Specification

void glEvalMesh2(GLenum mode,
                                  GLint i1,
                                  GLint i2,
                                  GLint j1,
                                  GLint j2);

Parameters

Image

Description

glMapGrid and glEvalMesh are used in tandem to efficiently generate and evaluate a series of evenly-spaced map domain values. glEvalMesh steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified by glMap1 and glMap2. mode determines whether the resulting vertices are connected as points, lines, or filled polygons.

In the one-dimensional case, glEvalMesh1, the mesh is generated as if the following code fragment were executed:

glBegin( type );
for ( i = i1; i <= i2; i += 1 )
     glEvalCoord1( i · Δ u + u1 );
glEnd();

where

Image

and n, u1, and u2 are the arguments to the most recent glMapGrid1 command. type is GL_POINTS if mode is GL_POINT, or GL_LINES if mode is GL_LINE.

The one absolute numeric requirement is that if i = n, then the value computed from i · Δu + u1 is exactly u2.

In the two-dimensional case, glEvalMesh2, let .cp

Image

Image

where n, u1, u2, m, v1, and v2 are the arguments to the most recent glMapGrid2 command. Then, if mode is GL_FILL, the glEvalMesh2 command is equivalent to:

for ( j = j1; j < j2; j += 1 ) {
     glBegin( GL_QUAD_STRIP );
     for ( i = i1; i <= i2; i += 1 ) {
          glEvalCoord2( i · Δu + u1, j · Δv + v1 );
          glEvalCoord2( i · Δu + u1, (j + 1) · Δv + v1 );
     }
     glEnd();
}
     If mode is GL_LINE, then a call to glEvalMesh2 is equivalent to:
for ( j = j1; j <= j2; j += 1 ) {
     glBegin( GL_LINE_STRIP );
     for ( i = i1; i <= i2; i += 1 )
          glEvalCoord2( i · Δu +u1, j · Δv +v1 );
     glEnd();
}
for ( i = i1; i <= i2 ; i += 1 ) {
     glBegin( GL_LINE_STRIP );
      for ( j = j1; j <= j1 ; j += 1 )
           glEvalCoord2( i · Δu +u1, j · Δv +v1 );
     glEnd();
}

And finally, if mode is GL_POINT, then a call to glEvalMesh2 is equivalent to:

glBegin( GL_POINTS );
for ( j = j1; j <= j2; j += 1 )
   for ( i = i1; i <= i2; i += 1 )
        glEvalCoord2( i · Δu +u1, j · Δv +v1 );
glEnd();

In all three cases, the only absolute numeric requirements are that if i = n, then the value computed from i · Δu + u1 is exactly u2, and if j = m, then the value computed from j · Δv + v1 is exactly v2.

Errors

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_OPERATION is generated if glEvalMesh is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGet with argument GL_MAP1_GRID_DOMAIN

glGet with argument GL_MAP2_GRID_DOMAIN

glGet with argument GL_MAP1_GRID_SEGMENTS

glGet with argument GL_MAP2_GRID_SEGMENTS

See Also

glBegin, glEvalCoord, glEvalPoint, glMap1, glMap2, glMapGrid

glEvalPoint

Generate and evaluate a single point in a mesh

C Specification

void glEvalPoint1(GLint i);
void glEvalPoint2(GLint i, GLint j);

Parameters

Image

Description

glMapGrid and glEvalMesh are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. glEvalPoint can be used to evaluate a single grid point in the same gridspace that is traversed by glEvalMesh. Calling glEvalPoint1 is equivalent to calling glEvalCoord1( i · Δu + u1 );

where

Image

and n, u1, and u2 are the arguments to the most recent glMapGrid1 command. The one absolute numeric requirement is that if i = n, then the value computed from i · Δu + u1 is exactly u2.

In the two-dimensional case, glEvalPoint2, let

Image

Image

where n, u1, u2, m, v1, and v2 are the arguments to the most recent glMapGrid2 command. Then the glEvalPoint2 command is equivalent to calling

glEvalCoord2 ( i · Δu + u1, j · Δv + v1 );

The only absolute numeric requirements are that if i = n, then the value computed from i · Δu + u1 is exactly u2, and if j = m, then the value computed from j· Δv + v1 is exactly v2.

Associated Gets

glGet with argument GL_MAP1_GRID_DOMAIN

glGet with argument GL_MAP2_GRID_DOMAIN

glGet with argument GL_MAP1_GRID_SEGMENTS

glGet with argument GL_MAP2_GRID_SEGMENTS

See Also

glEvalCoord, glEvalMesh, glMap1, glMap2, glMapGrid

glFeedbackBuffer

Controls feedback mode

C Specification

void glFeedbackBuffer(GLsizei size,
                                           GLenum type,
                                           GLfloat * buffer);

Parameters

Image

Description

The glFeedbackBuffer function controls feedback. Feedback, like selection, is a GL mode. The mode is selected by calling glRenderMode with GL_FEEDBACK. When the GL is in feedback mode, no pixels are produced by rasterization. Instead, information about primitives that would have been rasterized is fed back to the application using the GL.

glFeedbackBuffer has three arguments: buffer is a pointer to an array of floating-point values into which feedback information is placed. size indicates the size of the array. type is a symbolic constant describing the information that is fed back for each vertex. glFeedbackBuffer must be issued before feedback mode is enabled (by calling glRenderMode with argument GL_FEEDBACK). Setting GL_FEEDBACK without establishing the feedback buffer, or calling glFeedbackBuffer while the GL is in feedback mode, is an error.

When glRenderMode is called while in feedback mode, it returns the number of entries placed in the feedback array and resets the feedback array pointer to the base of the feedback buffer. The returned value never exceeds size. If the feedback data required more room than was available in buffer, glRenderMode returns a negative value. To take the GL out of feedback mode, call glRenderMode with a parameter value other than GL_FEEDBACK.

While in feedback mode, each primitive, bitmap, or pixel rectangle that would be rasterized generates a block of values that are copied into the feedback array. If doing so would cause the number of entries to exceed the maximum, the block is partially written so as to fill the array (if there is any room left at all), and an overflow flag is set. Each block begins with a code indicating the primitive type, followed by values that describe the primitive’s vertices and associated data. Entries are also written for bitmaps and pixel rectangles. Feedback occurs after polygon culling and glPolygonMode interpretation of polygons has taken place, so polygons that are culled are not returned in the feedback buffer. It can also occur after polygons with more than three edges are broken up into triangles, if the GL implementation renders polygons by performing this decomposition.

The glPassThrough command can be used to insert a marker into the feedback buffer. See glPassThrough.

Following is the grammar for the blocks of values written into the feedback buffer. Each primitive is indicated with a unique identifying value followed by some number of vertices. Polygon entries include an integer value indicating how many vertices follow. A vertex is fed back as some number of floating-point values, as determined by type. Colors are fed back as four values in RGBA mode and one value in color index mode.

feedbackList ← feedbackItem feedbackList | feedbackItem

feedbackItem ← point | lineSegment | polygon | bitmap | pixelRectangle | passThru

point ← GL_POINT_TOKEN vertex

lineSegment ← GL_LINE_TOKEN vertex vertex | GL_LINE_RESET_TOKEN vertex vertex

polygon ← GL_POLYGON_TOKEN n polySpec

polySpec ← polySpec vertex | vertex vertex vertex

bitmap ← GL_BITMAP_TOKEN vertex

pixelRectangle ← GL_DRAW_PIXEL_TOKEN vertex | GL_COPY_PIXEL_TOKEN vertex

passThru ← GL_PASS_THROUGH_TOKEN value

vertex ← 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture

2d ← value value

3d ← value value value

3dColor ← value value value color

3dColorTexture ← value value value color tex

4dColorTexture ← value value value value color tex

color ← rgba | index

rgba ← value value value value

index ← value

tex ← value value value value

value is a floating-point number, and n is a floating-point integer giving the number of vertices in the polygon. GL_POINT_TOKEN, GL_LINE_TOKEN, GL_LINE_RESET_TOKEN, GL_POLYGON_TOKEN, GL_BITMAP_TOKEN, GL_DRAW_PIXEL_TOKEN, GL_COPY_PIXEL_TOKEN and GL_PASS_THROUGH_TOKEN are symbolic floating-point constants. GL_LINE_RESET_TOKEN is returned whenever the line stipple pattern is reset. The data returned as a vertex depends on the feedback type.

The following table gives the correspondence between type and the number of values per vertex. k is 1 in color index mode and 4 in RGBA mode.

Image

Feedback vertex coordinates are in window coordinates, except w, which is in clip coordinates. Feedback colors are lighted, if lighting is enabled. Feedback texture coordinates are generated, if texture coordinate generation is enabled. They are always transformed by the texture matrix.

Notes

glFeedbackBuffer, when used in a display list, is not compiled into the display list but is executed immediately.

glFeedbackBuffer returns only the texture coordinate of texture unit GL_TEXTURE0.

Errors

GL_INVALID_ENUM is generated if type is not an accepted value.

GL_INVALID_VALUE is generated if size is negative.

GL_INVALID_OPERATION is generated if glFeedbackBuffer is called while the render mode is GL_FEEDBACK, or if glRenderMode is called with argument GL_FEEDBACK before glFeedbackBuffer is called at least once.

GL_INVALID_OPERATION is generated if glFeedbackBuffer is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGet with argument GL_RENDER_MODE

glGet with argument GL_FEEDBACK_BUFFER_POINTER

glGet with argument GL_FEEDBACK_BUFFER_SIZE

glGet with argument GL_FEEDBACK_BUFFER_TYPE

See Also

glBegin, glLineStipple, glPassThrough, glPolygonMode, glRenderMode, glSelectBuffer

glFinish

Block until all GL execution is complete

C Specification

void glFinish(void);

Description

glFinish does not return until the effects of all previously called GL commands are complete. Such effects include all changes to GL state, all changes to connection state, and all changes to the frame buffer contents.

Notes

glFinish requires a round trip to the server.

Errors

GL_INVALID_OPERATION is generated if glFinish is executed between the execution of glBegin and the corresponding execution of glEnd.

See Also

glFlush

glFlush

Force execution of GL commands in finite time

C Specification

void glFlush(void);

Description

Different GL implementations buffer commands in several different locations, including network buffers and the graphics accelerator itself. glFlush empties all of these buffers, causing all issued commands to be executed as quickly as they are accepted by the actual rendering engine. Though this execution may not be completed in any particular time period, it does complete in finite time.

Because any GL program might be executed over a network, or on an accelerator that buffers commands, all programs should call glFlush whenever they count on having all of their previously issued commands completed. For example, call glFlush before waiting for user input that depends on the generated image.

Notes

glFlush can return at any time. It does not wait until the execution of all previously issued GL commands is complete.

Errors

GL_INVALID_OPERATION is generated if glFlush is executed between the execution of glBegin and the corresponding execution of glEnd.

See Also

glFinish

glFog

Specify fog parameters

C Specification

void glFogf(GLenum pname, GLfloat param);
void glFogi(GLenum pname, GLint param);

Parameters

Image

C Specification

void glFogfv(GLenum          pname,
             const GLfloat * params);
void glFogiv(GLenum          pname,
             const GLint *  params);

Parameters

Image

Description

Fog is initially disabled. While enabled, fog affects rasterized geometry, bitmaps, and pixel blocks, but not buffer clear operations. To enable and disable fog, call glEnable and glDisable with argument GL_FOG.

glFog assigns the value or values in params to the fog parameter specified by pname. The following values are accepted for pname:

GL_FOG_MODE

params is a single integer or floating-point value that specifies the equation to be used to compute the fog blend factor, f. Three symbolic constants are accepted: GL_LINEAR, GL_EXP, and GL_EXP2. The equations corresponding to these symbolic constants are defined below. The initial fog mode is GL_EXP.

GL_FOG_DENSITY

params is a single integer or floating-point value that specifies density, the fog density used in both exponential fog equations. Only nonnegative densities are accepted. The initial fog density is 1.

GL_FOG_START

params is a single integer or floating-point value that specifies start, the near distance used in the linear fog equation. The initial near distance is 0.

GL_FOG_END

params is a single integer or floating-point value that specifies end, the far distance used in the linear fog equation. The initial far distance is 1.

GL_FOG_INDEX

params is a single integer or floating-point value that specifies if, the fog color index. The initial fog index is 0.

GL_FOG_COLOR

params contains four integer or floating-point values that specify Cf, the fog color. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. After conversion, all color components are clamped to the range [0,1]. The initial fog color is (0, 0, 0, 0).

GL_FOG_COORD_SRC

params contains either of the following symbolic constants: GL_FOG_COORD or GL_FRAGMENT_DEPTH. GL_FOG_COORD specifies that the current fog coordinate should be used as distance value in the fog color computation. GL_FRAGMENT_DEPTH specifies that the current fragment depth should be used as distance value in the fog computation.

Fog blends a fog color with each rasterized pixel fragment’s post-texturing color using a blending factor f. Factor f is computed in one of three ways, depending on the fog mode. Let c be either the distance in eye coordinate from the origin (in the case that the GL_FOG_COORD_SRC is GL_FRAGMENT_DEPTH) or the current fog coordinate (in the case that GL_FOG_COORD_SRC is GL_FOG_COORD). The equation for GL_LINEAR fog is

Image

The equation for GL_EXP fog is

f = e (density · c)

The equation for GL_EXP2 fog is

f = e (density · c) 2

Regardless of the fog mode, f is clamped to the range [0,1] after it is computed. Then, if the GL is in RGBA color mode, the fragment’s red, green, and blue colors, represented by Cr, are replaced by

Cr = f × Cr + (1 – f) × Cf

Fog does not affect a fragment’s alpha component.

In color index mode, the fragment’s color index ir is replaced by

ir = ir + (1 – f) × if

Notes

GL_FOG_COORD_SRC is available only if the GL version is 1.4 or greater.

Errors

GL_INVALID_ENUM is generated if pname is not an accepted value, or if pname is GL_FOG_MODE and params is not an accepted value.

GL_INVALID_VALUE is generated if pname is GL_FOG_DENSITY and params is negative.

GL_INVALID_OPERATION is generated if glFog is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glIsEnabled with argument GL_FOG

glGet with argument GL_FOG_COLOR

glGet with argument GL_FOG_INDEX

glGet with argument GL_FOG_DENSITY

glGet with argument GL_FOG_START

glGet with argument GL_FOG_END

glGet with argument GL_FOG_MODE

See Also

glEnable

glFogCoord

Set the current fog coordinates

C Specification

void glFogCoordd(GLfloat coord);
void glFogCoordf(GLfloat coord);

Parameters

Image

C Specification

void glFogCoorddv(GLfloat * coord);
void glFogCoordfv(GLfloat * coord);

Parameters

Image

Description

glFogCoord specifies the fog coordinate that is associated with each vertex and the current raster position. The value specified is interpolated and used in computing the fog color (see glFog).

Notes

glFogCoord is available only if the GL version is 1.4 or greater.

The current fog coordinate can be updated at any time. In particular, glFogCoord can be called between a call to glBegin and the corresponding call to glEnd.

Associated Gets

glGet with argument GL_CURRENT_FOG_COORD

See Also

glFog, glFogCoordPointer, glVertex

glFogCoordPointer

Define an array of fog coordinates

C Specification

void glFogCoordPointer(GLenum type,
                                             GLsizei stride,
                                             GLvoid * pointer);

Parameters

Image

Description

glFogCoordPointer specifies the location and data format of an array of fog coordinates to use when rendering. type specifies the data type of each fog coordinate, and stride specifies the byte stride from one fog coordinate to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

If a nonzero named buffer object is bound to the GL_ARRAY_BUFFER target (see glBindBuffer) while a fog coordinate array is specified, pointer is treated as a byte offset into the buffer object’s data store. Also, the buffer object binding (GL_ARRAY_BUFFER_BINDING) is saved as fog coordinate vertex array client-side state (GL_FOG_COORD_ARRAY_BUFFER_BINDING).

When a fog coordinate array is specified, type, stride, and pointer are saved as client-side state, in addition to the current vertex array buffer object binding.

To enable and disable the fog coordinate array, call glEnableClientState and glDisableClientState with the argument GL_FOG_COORD_ARRAY. If enabled, the fog coordinate array is used when glDrawArrays, glMultiDrawArrays, glDrawElements, glMultiDrawElements, glDrawRangeElements, or glArrayElement is called.

Notes

glFogCoordPointer is available only if the GL version is 1.4 or greater.

Fog coordinates are not supported for interleaved vertex array formats (see glInterleavedArrays).

The fog coordinate array is initially disabled and isn’t accessed when glArrayElement, glDrawElements, glDrawRangeElements, glDrawArrays, glMultiDrawArrays, or glMultiDrawElements is called.

Execution of glFogCoordPointer is not allowed between the execution of glBegin and the corresponding execution of glEnd, but an error may or may not be generated. If no error is generated, the operation is undefined.

glFogCoordPointer is typically implemented on the client side with no protocol.

Fog coordinate array parameters are client-side state and are therefore not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead.

Errors

GL_INVALID_ENUM is generated if type is not either GL_FLOAT or GL_DOUBLE.

GL_INVALID_VALUE is generated if stride is negative.

Associated Gets

glIsEnabled with argument GL_FOG_COORD_ARRAY

glGet with argument GL_FOG_COORD_ARRAY_STRIDE

glGet with argument GL_FOG_COORD_ARRAY_TYPE

glGet with argument GL_FOG_COORD_ARRAY_BUFFER_BINDING

glGet with argument GL_ARRAY_BUFFER_BINDING

glGetPointerv with argument GL_FOG_COORD_ARRAY_POINTER

See Also

glArrayElement, glBindBuffer, glColorPointer, glDisableClientState, glDrawArrays, glDrawElements, glDrawRangeElements, glEdgeFlagPointer, glEnableClientState, glFogCoord, glIndexPointer, glInterleavedArrays, glMultiDrawArrays, glMultiDrawElements, glNormalPointer, glPopClientAttrib, glPushClientAttrib, glSecondaryColorPointer, glTexCoordPointer, glVertexAttribPointer, glVertexPointer

glFrontFace

Define front- and back-facing polygons

C Specification

void glFrontFace(GLenum mode);

Parameters

Image

Description

In a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. Eliminating these invisible polygons has the obvious benefit of speeding up the rendering of the image. To enable and disable elimination of back-facing polygons, call glEnable and glDisable with argument GL_CULL_FACE.

The projection of a polygon to window coordinates is said to have clockwise winding if an imaginary object following the path from its first vertex, its second vertex, and so on, to its last vertex, and finally back to its first vertex, moves in a clockwise direction about the interior of the polygon. The polygon’s winding is said to be counterclockwise if the imaginary object following the same path moves in a counterclockwise direction about the interior of the polygon. glFrontFace specifies whether polygons with clockwise winding in window coordinates, or counterclockwise winding in window coordinates, are taken to be front-facing. Passing GL_CCW to mode selects counterclockwise polygons as front-facing; GL_CW selects clockwise polygons as front-facing. By default, counterclockwise polygons are taken to be front-facing.

Errors

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_OPERATION is generated if glFrontFace is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGet with argument GL_FRONT_FACE

See Also

glCullFace, glLightModel

glFrustum

Multiply the current matrix by a perspective matrix

C Specification

void glFrustum(GLdouble left,
                            GLdouble right,
                            GLdouble bottom,
                            GLdouble top,
                            GLdouble nearVal,
                            GLdouble farVal);

Parameters

Image

Description

glFrustum describes a perspective matrix that produces a perspective projection. The current matrix (see glMatrixMode) is multiplied by this matrix and the result replaces the current matrix, as if glMultMatrix were called with the following matrix as its argument:

Image

Typically, the matrix mode is GL_PROJECTION, and (left, bottom, -nearVal) and (right, top, -nearVal) specify the points on the near clipping plane that are mapped to the lower left and upper-right corners of the window, assuming that the eye is located at (0, 0, 0). -farVal specifies the location of the far clipping plane. Both nearVal and farVal must be positive.

Use glPushMatrix and glPopMatrix to save and restore the current matrix stack.

Notes

Depth buffer precision is affected by the values specified for nearVal and farVal. The greater the ratio of farVal to nearVal is, the less effective the depth buffer will be at distinguishing between surfaces that are near each other. If

Image

roughly log2 (r) bits of depth buffer precision are lost. Because r approaches infinity as nearVal approaches 0, nearVal must never be set to 0.

Errors

GL_INVALID_VALUE is generated if nearVal or farVal is not positive, or if left = right, or bottom = top.

GL_INVALID_OPERATION is generated if glFrustum is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGet with argument GL_MATRIX_MODE

glGet with argument GL_MODELVIEW_MATRIX

glGet with argument GL_PROJECTION_MATRIX

glGet with argument GL_TEXTURE_MATRIX

glGet with argument GL_COLOR_MATRIX

See Also

glOrtho, glMatrixMode, glMultMatrix, glPushMatrix, glViewport

glGenBuffers

Generate buffer object names

C Specification

void glGenBuffers(GLsizei n,
                  GLuint * buffers);

Parameters

Image

Description

glGenBuffers returns n buffer object names in buffers. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to glGenBuffers.

Buffer object names returned by a call to glGenBuffers are not returned by subsequent calls, unless they are first deleted with glDeleteBuffers.

No buffer objects are associated with the returned buffer object names until they are first bound by calling glBindBuffer.

Notes

glGenBuffers is available only if the GL version is 1.5 or greater.

Errors

GL_INVALID_VALUE is generated if n is negative.

GL_INVALID_OPERATION is generated if glGenBuffers is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glIsBuffer

See Also

glBindBuffer, glDeleteBuffers, glGet

glGenLists

Generate a contiguous set of empty display lists

C Specification

GLuint glGenLists(GLsizei range);

Parameters

Image

Description

glGenLists has one argument, range. It returns an integer n such that range contiguous empty display lists, named n, n + 1,..., n + range – 1, are created. If range is 0, if there is no group of range contiguous names available, or if any error is generated, no display lists are generated, and 0 is returned.

Errors

GL_INVALID_VALUE

is generated if range is negative.

GL_INVALID_OPERATION is generated if glGenLists is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glIsList

See Also

glCallList, glCallLists, glDeleteLists, glNewList

glGenQueries

Generate query object names

C Specification

void glGenQueries(GLsizei n, GLuint * ids);

Parameters

Image

Description

glGenQueries returns n query object names in ids. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to glGenQueries.

Query object names returned by a call to glGenQueries are not returned by subsequent calls, unless they are first deleted with glDeleteQueries.

No query objects are associated with the returned query object names until they are first used by calling glBeginQuery.

Notes

glGenQueries is available only if the GL version is 1.5 or greater.

Errors

GL_INVALID_VALUE is generated if n is negative.

GL_INVALID_OPERATION is generated if glGenQueries is executed between the execution of glBeginQuery and the corresponding execution of glEndQuery.

GL_INVALID_OPERATION is generated if glGenQueries is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glIsQuery

See Also

glBeginQuery, glDeleteQueries, glEndQuery

glGenTextures

Generate texture names

C Specification

void glGenTextures(GLsizei n,
                                      GLuint * textures);

Parameters

Image

Description

glGenTextures returns n texture names in textures. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to glGenTextures.

The generated textures have no dimensionality; they assume the dimensionality of the texture target to which they are first bound (see glBindTexture).

Texture names returned by a call to glGenTextures are not returned by subsequent calls, unless they are first deleted with glDeleteTextures.

Notes

glGenTextures is available only if the GL version is 1.1 or greater.

Errors

GL_INVALID_VALUE is generated if n is negative.

GL_INVALID_OPERATION is generated if glGenTextures is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glIsTexture

See Also

glBindTexture, glCopyTexImage1D, glCopyTexImage2D, glDeleteTextures, glGet, glGetTexParameter, glTexImage1D, glTexImage2D, glTexImage3D, glTexParameter

glGet

Return the value or values of a selected parameter

C Specification

void glGetBooleanv(GLenum      pname,
                                     GLboolean * params);

C Specification

void glGetDoublev(GLenum     pname,
                                   GLdouble * params);

C Specification

void glGetFloatv(GLenum    pname,
                               GLfloat * params);

C Specification

void glGetIntegerv(GLenum  pname,
                                   GLint * params);

Parameters

Image

Description

These four commands return values for simple state variables in GL. pname is a symbolic constant indicating the state variable to be returned, and params is a pointer to an array of the indicated type in which to place the returned data.

Type conversion is performed if params has a different type than the state variable value being requested. If glGetBooleanv is called, a floating-point (or integer) value is converted to GL_FALSE if and only if it is 0.0 (or 0). Otherwise, it is converted to GL_TRUE. If glGetIntegerv is called, boolean values are returned as GL_TRUE or GL_FALSE, and most floating-point values are rounded to the nearest integer value. Floating-point colors and normals, however, are returned with a linear mapping that maps 1.0 to the most positive representable integer value and -1.0 to the most negative representable integer value. If glGetFloatv or glGetDoublev is called, boolean values are returned as GL_TRUE or GL_FALSE, and integer values are converted to floating-point values.

The following symbolic constants are accepted by pname:

GL_ACCUM_ALPHA_BITS

params returns one value, the number of alpha bitplanes in the accumulation buffer.

GL_ACCUM_BLUE_BITS

params returns one value, the number of blue bitplanes in the accumulation buffer.

GL_ACCUM_CLEAR_VALUE

params returns four values: the red, green, blue, and alpha values used to clear the accumulation buffer. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. The initial value is (0, 0, 0, 0). See glClearAccum.

GL_ACCUM_GREEN_BITS

params returns one value, the number of green bitplanes in the accumulation buffer.

GL_ACCUM_RED_BITS

params returns one value, the number of red bitplanes in the accumulation buffer.

GL_ACTIVE_TEXTURE

params returns a single value indicating the active multitexture unit. The initial value is GL_TEXTURE0. See glActiveTexture.

GL_ALIASED_POINT_SIZE_RANGE

params returns two values, the smallest and largest supported sizes for aliased points.

GL_ALIASED_LINE_WIDTH_RANGE

params returns two values, the smallest and largest supported widths for aliased lines.

GL_ALPHA_BIAS

params returns one value, the alpha bias factor used during pixel transfers. The initial value is 0. See glPixelTransfer.

GL_ALPHA_BITS

params returns one value, the number of alpha bitplanes in each color buffer.

GL_ALPHA_SCALE

params returns one value, the alpha scale factor used during pixel transfers. The initial value is 1. See glPixelTransfer.

GL_ALPHA_TEST

params returns a single boolean value indicating whether alpha testing of fragments is enabled. The initial value is GL_FALSE. See glAlphaFunc.

GL_ALPHA_TEST_FUNC

params returns one value, the symbolic name of the alpha test function. The initial value is GL_ALWAYS. See glAlphaFunc.

GL_ALPHA_TEST_REF

params returns one value, the reference value for the alpha test. The initial value is 0. See glAlphaFunc. An integer value, if requested, is linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value.

GL_ARRAY_BUFFER_BINDING

params returns a single value, the name of the buffer object currently bound to the target GL_ARRAY_BUFFER. If no buffer object is bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_ATTRIB_STACK_DEPTH

params returns one value, the depth of the attribute stack. If the stack is empty, 0 is returned. The initial value is 0. See glPushAttrib.

GL_AUTO_NORMAL

params returns a single boolean value indicating whether 2D map evaluation automatically generates surface normals. The initial value is GL_FALSE. See glMap2.

GL_AUX_BUFFERS

params returns one value, the number of auxiliary color buffers available.

GL_BLEND

params returns a single boolean value indicating whether blending is enabled. The initial value is GL_FALSE. See glBlendFunc.

GL_BLEND_COLOR

params returns four values, the red, green, blue, and alpha values which are the components of the blend color. See glBlendColor.

GL_BLEND_DST_ALPHA

params returns one value, the symbolic constant identifying the alpha destination blend function. The initial value is GL_ZERO. See glBlendFunc and glBlendFuncSeparate.

GL_BLEND_DST_RGB

params returns one value, the symbolic constant identifying the RGB destination blend function. The initial value is GL_ZERO. See glBlendFunc and glBlendFuncSeparate.

GL_BLEND_EQUATION_RGB

params returns one value, a symbolic constant indicating whether the RGB blend equation is GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MIN or GL_MAX. See glBlendEquationSeparate.

GL_BLEND_EQUATION_ALPHA

params returns one value, a symbolic constant indicating whether the Alpha blend equation is GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MIN or GL_MAX. See glBlendEquationSeparate.

GL_BLEND_SRC_ALPHA

params returns one value, the symbolic constant identifying the alpha source blend function. The initial value is GL_ONE. See glBlendFunc and glBlendFuncSeparate.

GL_BLEND_SRC_RGB

params returns one value, the symbolic constant identifying the RGB source blend function. The initial value is GL_ONE. See glBlendFunc and glBlendFuncSeparate.

GL_BLUE_BIAS

params returns one value, the blue bias factor used during pixel transfers. The initial value is 0. See glPixelTransfer.

GL_BLUE_BITS

params returns one value, the number of blue bitplanes in each color buffer.

GL_BLUE_SCALE

params returns one value, the blue scale factor used during pixel transfers. The initial value is 1. See glPixelTransfer.

GL_CLIENT_ACTIVE_TEXTURE

params returns a single integer value indicating the current client active multitexture unit. The initial value is GL_TEXTURE0. See glClientActiveTexture.

GL_CLIENT_ATTRIB_STACK_DEPTH

params returns one value indicating the depth of the attribute stack. The initial value is 0. See glPushClientAttrib.

GL_CLIP_PLANEi

params returns a single boolean value indicating whether the specified clipping plane is enabled. The initial value is GL_FALSE. See glClipPlane.

GL_COLOR_ARRAY

params returns a single boolean value indicating whether the color array is enabled. The initial value is GL_FALSE. See glColorPointer.

GL_COLOR_ARRAY_BUFFER_BINDING

params returns a single value, the name of the buffer object associated with the color array. This buffer object would have been bound to the target GL_ARRAY_BUFFER at the time of the most recent call to glColorPointer. If no buffer object was bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_COLOR_ARRAY_SIZE

params returns one value, the number of components per color in the color array. The initial value is 4. See glColorPointer.

GL_COLOR_ARRAY_STRIDE

params returns one value, the byte offset between consecutive colors in the color array. The initial value is 0. See glColorPointer.

GL_COLOR_ARRAY_TYPE

params returns one value, the data type of each component in the color array. The initial value is GL_FLOAT. See glColorPointer.

GL_COLOR_CLEAR_VALUE

params returns four values: the red, green, blue, and alpha values used to clear the color buffers. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. The initial value is (0, 0, 0, 0). See glClearColor.

GL_COLOR_LOGIC_OP

params returns a single boolean value indicating whether a fragment’s RGBA color values are merged into the framebuffer using a logical operation. The initial value is GL_FALSE. See glLogicOp.

GL_COLOR_MATERIAL

params returns a single boolean value indicating whether one or more material parameters are tracking the current color. The initial value is GL_FALSE. See glColorMaterial.

GL_COLOR_MATERIAL_FACE

params returns one value, a symbolic constant indicating which materials have a parameter that is tracking the current color. The initial value is GL_FRONT_AND_BACK. See glColorMaterial.

GL_COLOR_MATERIAL_PARAMETER

params returns one value, a symbolic constant indicating which material parameters are tracking the current color. The initial value is GL_AMBIENT_AND_DIFFUSE. See glColorMaterial.

GL_COLOR_MATRIX

params returns sixteen values: the color matrix on the top of the color matrix stack. Initially this matrix is the identity matrix. See glPushMatrix.

GL_COLOR_MATRIX_STACK_DEPTH

params returns one value, the maximum supported depth of the projection matrix stack. The value must be at least 2. See glPushMatrix.

GL_COLOR_SUM

params returns a single boolean value indicating whether primary and secondary color sum is enabled. See glSecondaryColor.

GL_COLOR_TABLE

params returns a single boolean value indicating whether the color table lookup is enabled. See glColorTable.

GL_COLOR_WRITEMASK

params returns four boolean values: the red, green, blue, and alpha write enables for the color buffers. The initial value is (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE). See glColorMask.

GL_COMPRESSED_TEXTURE_FORMATS

params returns a GL_NUM_COMPRESSED_TEXTURE_FORMATS of symbolic constants indicating which compressed texture formats are available. See glCompressedTexImage2D.

GL_CONVOLUTION_1D

params returns a single boolean value indicating whether 1D convolution is enabled. The initial value is GL_FALSE. See glConvolutionFilter1D.

GL_CONVOLUTION_2D

params returns a single boolean value indicating whether 2D convolution is enabled. The initial value is GL_FALSE. See glConvolutionFilter2D.

GL_CULL_FACE

params returns a single boolean value indicating whether polygon culling is enabled. The initial value is GL_FALSE. See glCullFace.

GL_CULL_FACE_MODE

params returns one value, a symbolic constant indicating which polygon faces are to be culled. The initial value is GL_BACK. See glCullFace.

GL_CURRENT_COLOR

params returns four values: the red, green, blue, and alpha values of the current color. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. The initial value is (1, 1, 1, 1). See glColor.

GL_CURRENT_FOG_COORD

params returns one value, the current fog coordinate. The initial value is 0. See glFogCoord.

GL_CURRENT_INDEX

params returns one value, the current color index. The initial value is 1. See glIndex.

GL_CURRENT_NORMAL

params returns three values: the x, y, and z values of the current normal. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. The initial value is (0, 0, 1). See glNormal.

GL_CURRENT_PROGRAM

params returns one value, the name of the program object that is currently active, or 0 if no program object is active. See glUseProgram.

GL_CURRENT_RASTER_COLOR

params returns four values: the red, green, blue, and alpha color values of the current raster position. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. The initial value is (1, 1, 1, 1). See glRasterPos.

GL_CURRENT_RASTER_DISTANCE

params returns one value, the distance from the eye to the current raster position. The initial value is 0. See glRasterPos.

GL_CURRENT_RASTER_INDEX

params returns one value, the color index of the current raster position. The initial value is 1. See glRasterPos.

GL_CURRENT_RASTER_POSITION

params returns four values: the x, y, z, and w components of the current raster position. x, y, and z are in window coordinates, and w is in clip coordinates. The initial value is (0, 0, 0, 1). See glRasterPos.

GL_CURRENT_RASTER_POSITION_VALID

params returns a single boolean value indicating whether the current raster position is valid. The initial value is GL_TRUE. See glRasterPos.

GL_CURRENT_RASTER_SECONDARY_COLOR

params returns four values: the red, green, blue, and alpha secondary color values of the current raster position. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. The initial value is (1, 1, 1, 1). See glRasterPos.

GL_CURRENT_RASTER_TEXTURE_COORDS

params returns four values: the s, t, r, and q texture coordinates of the current raster position. The initial value is (0, 0, 0, 1). See glRasterPos and glMultiTexCoord.

GL_CURRENT_SECONDARY_COLOR

params returns four values: the red, green, blue, and alpha values of the current secondary color. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. The initial value is (0, 0, 0, 0). See glSecondaryColor.

GL_CURRENT_TEXTURE_COORDS

params returns four values: the s, t, r, and q current texture coordinates. The initial value is (0, 0, 0, 1). See glMultiTexCoord.

GL_DEPTH_BIAS

params returns one value, the depth bias factor used during pixel transfers. The initial value is 0. See glPixelTransfer.

GL_DEPTH_BITS

params returns one value, the number of bitplanes in the depth buffer.

GL_DEPTH_CLEAR_VALUE

params returns one value, the value that is used to clear the depth buffer. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. The initial value is 1. See glClearDepth.

GL_DEPTH_FUNC

params returns one value, the symbolic constant that indicates the depth comparison function. The initial value is GL_LESS. See glDepthFunc.

GL_DEPTH_RANGE

params returns two values: the near and far mapping limits for the depth buffer. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. The initial value is (0, 1). See glDepthRange.

GL_DEPTH_SCALE

params returns one value, the depth scale factor used during pixel transfers. The initial value is 1. See glPixelTransfer.

GL_DEPTH_TEST

params returns a single boolean value indicating whether depth testing of fragments is enabled. The initial value is GL_FALSE. See glDepthFunc and glDepthRange.

GL_DEPTH_WRITEMASK

params returns a single boolean value indicating if the depth buffer is enabled for writing. The initial value is GL_TRUE. See glDepthMask.

GL_DITHER

params returns a single boolean value indicating whether dithering of fragment colors and indices is enabled. The initial value is GL_TRUE.

GL_DOUBLEBUFFER

params returns a single boolean value indicating whether double buffering is supported.

GL_DRAW_BUFFER

params returns one value, a symbolic constant indicating which buffers are being drawn to. See glDrawBuffer. The initial value is GL_BACK if there are back buffers, otherwise it is GL_FRONT.

GL_DRAW_BUFFERi

params returns one value, a symbolic constant indicating which buffers are being drawn to by the corresponding output color. See glDrawBuffers. The initial value of GL_DRAW_BUFFER0 is GL_BACK if there are back buffers, otherwise it is GL_FRONT. The initial values of draw buffers for all other output colors is GL_NONE.

GL_EDGE_FLAG

params returns a single boolean value indicating whether the current edge flag is GL_TRUE or GL_FALSE. The initial value is GL_TRUE. See glEdgeFlag.

GL_EDGE_FLAG_ARRAY

params returns a single boolean value indicating whether the edge flag array is enabled. The initial value is GL_FALSE. See glEdgeFlagPointer.

GL_EDGE_FLAG_ARRAY_BUFFER_BINDING

params returns a single value, the name of the buffer object associated with the edge flag array. This buffer object would have been bound to the target GL_ARRAY_BUFFER at the time of the most recent call to glEdgeFlagPointer. If no buffer object was bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_EDGE_FLAG_ARRAY_STRIDE

params returns one value, the byte offset between consecutive edge flags in the edge flag array. The initial value is 0. See glEdgeFlagPointer.

GL_ELEMENT_ARRAY_BUFFER_BINDING

params returns a single value, the name of the buffer object currently bound to the target GL_ELEMENT_ARRAY_BUFFER. If no buffer object is bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_FEEDBACK_BUFFER_SIZE

params returns one value, the size of the feedback buffer. See glFeedbackBuffer.

GL_FEEDBACK_BUFFER_TYPE

params returns one value, the type of the feedback buffer. See glFeedbackBuffer.

GL_FOG

params returns a single boolean value indicating whether fogging is enabled. The initial value is GL_FALSE. See glFog.

GL_FOG_COORD_ARRAY

params returns a single boolean value indicating whether the fog coordinate array is enabled. The initial value is GL_FALSE. See glFogCoordPointer.

GL_FOG_COORD_ARRAY_BUFFER_BINDING

params returns a single value, the name of the buffer object associated with the fog coordinate array. This buffer object would have been bound to the target GL_ARRAY_BUFFER at the time of the most recent call to glFogCoordPointer. If no buffer object was bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_FOG_COORD_ARRAY_STRIDE

params returns one value, the byte offset between consecutive fog coordinates in the fog coordinate array. The initial value is 0. See glFogCoordPointer.

GL_FOG_COORD_ARRAY_TYPE

params returns one value, the type of the fog coordinate array. The initial value is GL_FLOAT. See glFogCoordPointer.

GL_FOG_COORD_SRC

params returns one value, a symbolic constant indicating the source of the fog coordinate. The initial value is GL_FRAGMENT_DEPTH. See glFog.

GL_FOG_COLOR

params returns four values: the red, green, blue, and alpha components of the fog color. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. The initial value is (0, 0, 0, 0). See glFog.

GL_FOG_DENSITY

params returns one value, the fog density parameter. The initial value is 1. See glFog.

GL_FOG_END

params returns one value, the end factor for the linear fog equation. The initial value is 1. See glFog.

GL_FOG_HINT

params returns one value, a symbolic constant indicating the mode of the fog hint. The initial value is GL_DONT_CARE. See glHint.

GL_FOG_INDEX

params returns one value, the fog color index. The initial value is 0. See glFog.

GL_FOG_MODE

params returns one value, a symbolic constant indicating which fog equation is selected. The initial value is GL_EXP. See glFog.

GL_FOG_START

params returns one value, the start factor for the linear fog equation. The initial value is 0. See glFog.

GL_FRAGMENT_SHADER_DERIVATIVE_HINT

params returns one value, a symbolic constant indicating the mode of the derivative accuracy hint for fragment shaders. The initial value is GL_DONT_CARE. See glHint.

GL_FRONT_FACE

params returns one value, a symbolic constant indicating whether clockwise or counterclockwise polygon winding is treated as front-facing. The initial value is GL_CCW. See glFrontFace.

GL_GENERATE_MIPMAP_HINT

params returns one value, a symbolic constant indicating the mode of the mipmap generation filtering hint. The initial value is GL_DONT_CARE. See glHint.

GL_GREEN_BIAS

params returns one value, the green bias factor used during pixel transfers. The initial value is 0.

GL_GREEN_BITS

params returns one value, the number of green bitplanes in each color buffer.

GL_GREEN_SCALE

params returns one value, the green scale factor used during pixel transfers. The initial value is 1. See glPixelTransfer.

GL_HISTOGRAM

params returns a single boolean value indicating whether histogram is enabled. The initial value is GL_FALSE. See glHistogram.

GL_INDEX_ARRAY

params returns a single boolean value indicating whether the color index array is enabled. The initial value is GL_FALSE. See glIndexPointer.

GL_INDEX_ARRAY_BUFFER_BINDING

params returns a single value, the name of the buffer object associated with the color index array. This buffer object would have been bound to the target GL_ARRAY_BUFFER at the time of the most recent call to glIndexPointer. If no buffer object was bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_INDEX_ARRAY_STRIDE

params returns one value, the byte offset between consecutive color indexes in the color index array. The initial value is 0. See glIndexPointer.

GL_INDEX_ARRAY_TYPE

params returns one value, the data type of indexes in the color index array. The initial value is GL_FLOAT. See glIndexPointer.

GL_INDEX_BITS

params returns one value, the number of bitplanes in each color index buffer.

GL_INDEX_CLEAR_VALUE

params returns one value, the color index used to clear the color index buffers. The initial value is 0. See glClearIndex.

GL_INDEX_LOGIC_OP

params returns a single boolean value indicating whether a fragment’s index values are merged into the framebuffer using a logical operation. The initial value is GL_FALSE. See glLogicOp.

GL_INDEX_MODE

params returns a single boolean value indicating whether the GL is in color index mode (GL_TRUE) or RGBA mode (GL_FALSE).

GL_INDEX_OFFSET

params returns one value, the offset added to color and stencil indices during pixel transfers. The initial value is 0. See glPixelTransfer.

GL_INDEX_SHIFT

params returns one value, the amount that color and stencil indices are shifted during pixel transfers. The initial value is 0. See glPixelTransfer.

GL_INDEX_WRITEMASK

params returns one value, a mask indicating which bitplanes of each color index buffer can be written. The initial value is all 1’s. See glIndexMask.

GL_LIGHTi

params returns a single boolean value indicating whether the specified light is enabled. The initial value is GL_FALSE. See glLight and glLightModel.

GL_LIGHTING

params returns a single boolean value indicating whether lighting is enabled. The initial value is GL_FALSE. See glLightModel.

GL_LIGHT_MODEL_AMBIENT

params returns four values: the red, green, blue, and alpha components of the ambient intensity of the entire scene. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. The initial value is (0.2, 0.2, 0.2, 1.0). See glLightModel.

GL_LIGHT_MODEL_COLOR_CONTROL

params returns single enumerated value indicating whether specular reflection calculations are separated from normal lighting computations. The initial value is GL_SINGLE_COLOR.

GL_LIGHT_MODEL_LOCAL_VIEWER

params returns a single boolean value indicating whether specular reflection calculations treat the viewer as being local to the scene. The initial value is GL_FALSE. See glLightModel.

GL_LIGHT_MODEL_TWO_SIDE

params returns a single boolean value indicating whether separate materials are used to compute lighting for front- and back-facing polygons. The initial value is GL_FALSE. See glLightModel.

GL_LINE_SMOOTH

params returns a single boolean value indicating whether antialiasing of lines is enabled. The initial value is GL_FALSE. See glLineWidth.

GL_LINE_SMOOTH_HINT

params returns one value, a symbolic constant indicating the mode of the line antialiasing hint. The initial value is GL_DONT_CARE. See glHint.

GL_LINE_STIPPLE

params returns a single boolean value indicating whether stippling of lines is enabled. The initial value is GL_FALSE. See glLineStipple.

GL_LINE_STIPPLE_PATTERN

params returns one value, the 16-bit line stipple pattern. The initial value is all 1’s. See glLineStipple.

GL_LINE_STIPPLE_REPEAT

params returns one value, the line stipple repeat factor. The initial value is 1. See glLineStipple.

GL_LINE_WIDTH

params returns one value, the line width as specified with glLineWidth. The initial value is 1.

GL_LINE_WIDTH_GRANULARITY

params returns one value, the width difference between adjacent supported widths for antialiased lines. See glLineWidth.

GL_LINE_WIDTH_RANGE

params returns two values: the smallest and largest supported widths for antialiased lines. See glLineWidth.

GL_LIST_BASE

params returns one value, the base offset added to all names in arrays presented to glCallLists. The initial value is 0. See glListBase.

GL_LIST_INDEX

params returns one value, the name of the display list currently under construction. 0 is returned if no display list is currently under construction. The initial value is 0. See glNewList.

GL_LIST_MODE

params returns one value, a symbolic constant indicating the construction mode of the display list currently under construction. The initial value is 0. See glNewList.

GL_LOGIC_OP_MODE

params returns one value, a symbolic constant indicating the selected logic operation mode. The initial value is GL_COPY. See glLogicOp.

GL_MAP1_COLOR_4

params returns a single boolean value indicating whether 1D evaluation generates colors. The initial value is GL_FALSE. See glMap1.

GL_MAP1_GRID_DOMAIN

params returns two values: the endpoints of the 1D map’s grid domain. The initial value is (0, 1). See glMapGrid.

GL_MAP1_GRID_SEGMENTS

params returns one value, the number of partitions in the 1D map’s grid domain. The initial value is 1. See glMapGrid.

GL_MAP1_INDEX

params returns a single boolean value indicating whether 1D evaluation generates color indices. The initial value is GL_FALSE. See glMap1.

GL_MAP1_NORMAL

params returns a single boolean value indicating whether 1D evaluation generates normals. The initial value is GL_FALSE. See glMap1.

GL_MAP1_TEXTURE_COORD_1

params returns a single boolean value indicating whether 1D evaluation generates 1D texture coordinates. The initial value is GL_FALSE. See glMap1.

GL_MAP1_TEXTURE_COORD_2

params returns a single boolean value indicating whether 1D evaluation generates 2D texture coordinates. The initial value is GL_FALSE. See glMap1.

GL_MAP1_TEXTURE_COORD_3

params returns a single boolean value indicating whether 1D evaluation generates 3D texture coordinates. The initial value is GL_FALSE. See glMap1.

GL_MAP1_TEXTURE_COORD_4

params returns a single boolean value indicating whether 1D evaluation generates 4D texture coordinates. The initial value is GL_FALSE. See glMap1.

GL_MAP1_VERTEX_3

params returns a single boolean value indicating whether 1D evaluation generates 3D vertex coordinates. The initial value is GL_FALSE. See glMap1.

GL_MAP1_VERTEX_4

params returns a single boolean value indicating whether 1D evaluation generates 4D vertex coordinates. The initial value is GL_FALSE. See glMap1.

GL_MAP2_COLOR_4

params returns a single boolean value indicating whether 2D evaluation generates colors. The initial value is GL_FALSE. See glMap2.

GL_MAP2_GRID_DOMAIN

params returns four values: the endpoints of the 2D map’s i and j grid domains. The initial value is (0,1; 0,1). See glMapGrid.

GL_MAP2_GRID_SEGMENTS

params returns two values: the number of partitions in the 2D map’s i and j grid domains. The initial value is (1,1). See glMapGrid.

GL_MAP2_INDEX

params returns a single boolean value indicating whether 2D evaluation generates color indices. The initial value is GL_FALSE. See glMap2.

GL_MAP2_NORMAL

params returns a single boolean value indicating whether 2D evaluation generates normals. The initial value is GL_FALSE. See glMap2.

GL_MAP2_TEXTURE_COORD_1

params returns a single boolean value indicating whether 2D evaluation generates 1D texture coordinates. The initial value is GL_FALSE. See glMap2.

GL_MAP2_TEXTURE_COORD_2

params returns a single boolean value indicating whether 2D evaluation generates 2D texture coordinates. The initial value is GL_FALSE. See glMap2.

GL_MAP2_TEXTURE_COORD_3

params returns a single boolean value indicating whether 2D evaluation generates 3D texture coordinates. The initial value is GL_FALSE. See glMap2.

GL_MAP2_TEXTURE_COORD_4

params returns a single boolean value indicating whether 2D evaluation generates 4D texture coordinates. The initial value is GL_FALSE. See glMap2.

GL_MAP2_VERTEX_3

params returns a single boolean value indicating whether 2D evaluation generates 3D vertex coordinates. The initial value is GL_FALSE. See glMap2.

GL_MAP2_VERTEX_4

params returns a single boolean value indicating whether 2D evaluation generates 4D vertex coordinates. The initial value is GL_FALSE. See glMap2.

GL_MAP_COLOR

params returns a single boolean value indicating if colors and color indices are to be replaced by table lookup during pixel transfers. The initial value is GL_FALSE. See glPixelTransfer.

GL_MAP_STENCIL

params returns a single boolean value indicating if stencil indices are to be replaced by table lookup during pixel transfers. The initial value is GL_FALSE. See glPixelTransfer.

GL_MATRIX_MODE

params returns one value, a symbolic constant indicating which matrix stack is currently the target of all matrix operations. The initial value is GL_MODELVIEW. See glMatrixMode.

GL_MAX_3D_TEXTURE_SIZE

params returns one value, a rough estimate of the largest 3D texture that the GL can handle. If the GL version is 1.2 or greater, use GL_PROXY_TEXTURE_3D to determine if a texture is too large. See glTexImage3D.

GL_MAX_CLIENT_ATTRIB_STACK_DEPTH

params returns one value indicating the maximum supported depth of the client attribute stack. See glPushClientAttrib.

GL_MAX_ATTRIB_STACK_DEPTH

params returns one value, the maximum supported depth of the attribute stack. The value must be at least 16. See glPushAttrib.

GL_MAX_CLIP_PLANES

params returns one value, the maximum number of application-defined clipping planes. The value must be at least 6. See glClipPlane.

GL_MAX_COLOR_MATRIX_STACK_DEPTH

params returns one value, the maximum supported depth of the color matrix stack. The value must be at least 2. See glPushMatrix.

GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS

params returns one value, the maximum supported texture image units that can be used to access texture maps from the vertex shader and the fragment processor combined. If both the vertex shader and the fragment processing stage access the same texture image unit, then that counts as using two texture image units against this limit. The value must be at least 2. See glActiveTexture.

GL_MAX_CUBE_MAP_TEXTURE_SIZE

params returns one value. The value gives a rough estimate of the largest cube-map texture that the GL can handle. If the GL version is 1.3 or greater, use GL_PROXY_TEXTURE_CUBE_MAP to determine if a texture is too large. See glTexImage2D.

GL_MAX_DRAW_BUFFERS

params returns one value, the maximum number of simultaneous output colors allowed from a fragment shader using the gl_FragData built-in array. The value must be at least 1. See glDrawBuffers.

GL_MAX_ELEMENTS_INDICES

params returns one value, the recommended maximum number of vertex array indices. See glDrawRangeElements.

GL_MAX_ELEMENTS_VERTICES

params returns one value, the recommended maximum number of vertex array vertices. See glDrawRangeElements.

GL_MAX_EVAL_ORDER

params returns one value, the maximum equation order supported by 1D and 2D evaluators. The value must be at least 8. See glMap1 and glMap2.

GL_MAX_FRAGMENT_UNIFORM_COMPONENTS

params returns one value, the maximum number of individual floating-point, integer, or boolean values that can be held in uniform variable storage for a fragment shader. The value must be at least 64. See glUniform.

GL_MAX_LIGHTS

params returns one value, the maximum number of lights. The value must be at least 8. See glLight.

GL_MAX_LIST_NESTING

params returns one value, the maximum recursion depth allowed during display-list traversal. The value must be at least 64. See glCallList.

GL_MAX_MODELVIEW_STACK_DEPTH

params returns one value, the maximum supported depth of the modelview matrix stack. The value must be at least 32. See glPushMatrix.

GL_MAX_NAME_STACK_DEPTH

params returns one value, the maximum supported depth of the selection name stack. The value must be at least 64. See glPushName.

GL_MAX_PIXEL_MAP_TABLE

params returns one value, the maximum supported size of a glPixelMap lookup table. The value must be at least 32. See glPixelMap.

GL_MAX_PROJECTION_STACK_DEPTH

params returns one value, the maximum supported depth of the projection matrix stack. The value must be at least 2. See glPushMatrix.

GL_MAX_TEXTURE_COORDS

params returns one value, the maximum number of texture coordinate sets available to vertex and fragment shaders. The value must be at least 2. See glActiveTexture and glClientActiveTexture.

GL_MAX_TEXTURE_IMAGE_UNITS

params returns one value, the maximum supported texture image units that can be used to access texture maps from the fragment shader. The value must be at least 2. See glActiveTexture.

GL_MAX_TEXTURE_LOD_BIAS

params returns one value, the maximum, absolute value of the texture level-of-detail bias. The value must be at least 4.

GL_MAX_TEXTURE_SIZE

params returns one value. The value gives a rough estimate of the largest texture that the GL can handle. If the GL version is 1.1 or greater, use GL_PROXY_TEXTURE_1D or GL_PROXY_TEXTURE_2D to determine if a texture is too large. See glTexImage1D and glTexImage2D.

GL_MAX_TEXTURE_STACK_DEPTH

params returns one value, the maximum supported depth of the texture matrix stack. The value must be at least 2. See glPushMatrix.

GL_MAX_TEXTURE_UNITS

params returns a single value indicating the number of conventional texture units supported. Each conventional texture unit includes both a texture coordinate set and a texture image unit. Conventional texture units may be used for fixed-function (non-shader) rendering. The value must be at least 2. Additional texture coordinate sets and texture image units may be accessed from vertex and fragment shaders. See glActiveTexture and glClientActiveTexture.

GL_MAX_VARYING_FLOATS

params returns one value, the maximum number of interpolators available for processing varying variables used by vertex and fragment shaders. This value represents the number of individual floating-point values that can be interpolated; varying variables declared as vectors, matrices, and arrays will all consume multiple interpolators. The value must be at least 32.

GL_MAX_VERTEX_ATTRIBS

params returns one value, the maximum number of 4-component generic vertex attributes accessible to a vertex shader. The value must be at least 16. See glVertexAttrib.

GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS

params returns one value, the maximum supported texture image units that can be used to access texture maps from the vertex shader. The value may be 0. See glActiveTexture.

GL_MAX_VERTEX_UNIFORM_COMPONENTS

params returns one value, the maximum number of individual floating-point, integer, or boolean values that can be held in uniform variable storage for a vertex shader. The value must be at least 512. See glUniform.

GL_MAX_VIEWPORT_DIMS

params returns two values: the maximum supported width and height of the viewport. These must be at least as large as the visible dimensions of the display being rendered to. See glViewport.

GL_MINMAX

params returns a single boolean value indicating whether pixel minmax values are computed. The initial value is GL_FALSE. See glMinmax.

GL_MODELVIEW_MATRIX

params returns sixteen values: the modelview matrix on the top of the modelview matrix stack. Initially this matrix is the identity matrix. See glPushMatrix.

GL_MODELVIEW_STACK_DEPTH

params returns one value, the number of matrices on the modelview matrix stack. The initial value is 1. See glPushMatrix.

GL_NAME_STACK_DEPTH

params returns one value, the number of names on the selection name stack. The initial value is 0. See glPushName.

GL_NORMAL_ARRAY

params returns a single boolean value, indicating whether the normal array is enabled. The initial value is GL_FALSE. See glNormalPointer.

GL_NORMAL_ARRAY_BUFFER_BINDING

params returns a single value, the name of the buffer object associated with the normal array. This buffer object would have been bound to the target GL_ARRAY_BUFFER at the time of the most recent call to glNormalPointer. If no buffer object was bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_NORMAL_ARRAY_STRIDE

params returns one value, the byte offset between consecutive normals in the normal array. The initial value is 0. See glNormalPointer.

GL_NORMAL_ARRAY_TYPE

params returns one value, the data type of each coordinate in the normal array. The initial value is GL_FLOAT. See glNormalPointer.

GL_NORMALIZE

params returns a single boolean value indicating whether normals are automatically scaled to unit length after they have been transformed to eye coordinates. The initial value is GL_FALSE. See glNormal.

GL_NUM_COMPRESSED_TEXTURE_FORMATS

params returns a single integer value indicating the number of available compressed texture formats. The minimum value is 0. See glCompressedTexImage2D.

GL_PACK_ALIGNMENT

params returns one value, the byte alignment used for writing pixel data to memory. The initial value is 4. See glPixelStore.

GL_PACK_IMAGE_HEIGHT

params returns one value, the image height used for writing pixel data to memory. The initial value is 0. See glPixelStore.

GL_PACK_LSB_FIRST

params returns a single boolean value indicating whether single-bit pixels being written to memory are written first to the least significant bit of each unsigned byte. The initial value is GL_FALSE. See glPixelStore.

GL_PACK_ROW_LENGTH

params returns one value, the row length used for writing pixel data to memory. The initial value is 0. See glPixelStore.

GL_PACK_SKIP_IMAGES

params returns one value, the number of pixel images skipped before the first pixel is written into memory. The initial value is 0. See glPixelStore.

GL_PACK_SKIP_PIXELS

params returns one value, the number of pixel locations skipped before the first pixel is written into memory. The initial value is 0. See glPixelStore.

GL_PACK_SKIP_ROWS

params returns one value, the number of rows of pixel locations skipped before the first pixel is written into memory. The initial value is 0. See glPixelStore.

GL_PACK_SWAP_BYTES

params returns a single boolean value indicating whether the bytes of two-byte and four-byte pixel indices and components are swapped before being written to memory. The initial value is GL_FALSE. See glPixelStore.

GL_PERSPECTIVE_CORRECTION_HINT

params returns one value, a symbolic constant indicating the mode of the perspective correction hint. The initial value is GL_DONT_CARE. See glHint.

GL_PIXEL_MAP_A_TO_A_SIZE

params returns one value, the size of the alpha-to-alpha pixel translation table. The initial value is 1. See glPixelMap.

GL_PIXEL_MAP_B_TO_B_SIZE

params returns one value, the size of the blue-to-blue pixel translation table. The initial value is 1. See glPixelMap.

GL_PIXEL_MAP_G_TO_G_SIZE

params returns one value, the size of the green-to-green pixel translation table. The initial value is 1. See glPixelMap.

GL_PIXEL_MAP_I_TO_A_SIZE

params returns one value, the size of the index-to-alpha pixel translation table. The initial value is 1. See glPixelMap.

GL_PIXEL_MAP_I_TO_B_SIZE

params returns one value, the size of the index-to-blue pixel translation table. The initial value is 1. See glPixelMap.

GL_PIXEL_MAP_I_TO_G_SIZE

params returns one value, the size of the index-to-green pixel translation table. The initial value is 1. See glPixelMap.

GL_PIXEL_MAP_I_TO_I_SIZE

params returns one value, the size of the index-to-index pixel translation table. The initial value is 1. See glPixelMap.

GL_PIXEL_MAP_I_TO_R_SIZE

params returns one value, the size of the index-to-red pixel translation table. The initial value is 1. See glPixelMap.

GL_PIXEL_MAP_R_TO_R_SIZE

params returns one value, the size of the red-to-red pixel translation table. The initial value is 1. See glPixelMap.

GL_PIXEL_MAP_S_TO_S_SIZE

params returns one value, the size of the stencil-to-stencil pixel translation table. The initial value is 1. See glPixelMap.

GL_PIXEL_PACK_BUFFER_BINDING

params returns a single value, the name of the buffer object currently bound to the target GL_PIXEL_PACK_BUFFER. If no buffer object is bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_PIXEL_UNPACK_BUFFER_BINDING

params returns a single value, the name of the buffer object currently bound to the target GL_PIXEL_UNPACK_BUFFER. If no buffer object is bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_POINT_DISTANCE_ATTENUATION

params returns three values, the coefficients for computing the attenuation value for points. See glPointParameter.

GL_POINT_FADE_THRESHOLD_SIZE

params returns one value, the point size threshold for determining the point size. See glPointParameter.

GL_POINT_SIZE

params returns one value, the point size as specified by glPointSize. The initial value is 1. GL_POINT_SIZE_GRANULARITY

params returns one value, the size difference between adjacent supported sizes for antialiased points. See glPointSize.

GL_POINT_SIZE_MAX

params returns one value, the upper bound for the attenuated point sizes. The initial value is 0.0. See glPointParameter.

GL_POINT_SIZE_MIN

params returns one value, the lower bound for the attenuated point sizes. The initial value is 1.0. See glPointParameter.

GL_POINT_SIZE_RANGE

params returns two values: the smallest and largest supported sizes for antialiased points. The smallest size must be at most 1, and the largest size must be at least 1. See glPointSize.

GL_POINT_SMOOTH

params returns a single boolean value indicating whether antialiasing of points is enabled. The initial value is GL_FALSE. See glPointSize.

GL_POINT_SMOOTH_HINT

params returns one value, a symbolic constant indicating the mode of the point antialiasing hint. The initial value is GL_DONT_CARE. See glHint.

GL_POINT_SPRITE

params returns a single boolean value indicating whether point sprite is enabled. The initial value is GL_FALSE.

GL_POLYGON_MODE

params returns two values: symbolic constants indicating whether front-facing and back-facing polygons are rasterized as points, lines, or filled polygons. The initial value is GL_FILL. See glPolygonMode.

GL_POLYGON_OFFSET_FACTOR

params returns one value, the scaling factor used to determine the variable offset that is added to the depth value of each fragment generated when a polygon is rasterized. The initial value is 0. See glPolygonOffset.

GL_POLYGON_OFFSET_UNITS

params returns one value. This value is multiplied by an implementation-specific value and then added to the depth value of each fragment generated when a polygon is rasterized. The initial value is 0. See glPolygonOffset.

GL_POLYGON_OFFSET_FILL

params returns a single boolean value indicating whether polygon offset is enabled for polygons in fill mode. The initial value is GL_FALSE. See glPolygonOffset.

GL_POLYGON_OFFSET_LINE

params returns a single boolean value indicating whether polygon offset is enabled for polygons in line mode. The initial value is GL_FALSE. See glPolygonOffset.

GL_POLYGON_OFFSET_POINT

params returns a single boolean value indicating whether polygon offset is enabled for polygons in point mode. The initial value is GL_FALSE. See glPolygonOffset.

GL_POLYGON_SMOOTH

params returns a single boolean value indicating whether antialiasing of polygons is enabled. The initial value is GL_FALSE. See glPolygonMode.

GL_POLYGON_SMOOTH_HINT

params returns one value, a symbolic constant indicating the mode of the polygon antialiasing hint. The initial value is GL_DONT_CARE. See glHint.

GL_POLYGON_STIPPLE

params returns a single boolean value indicating whether polygon stippling is enabled. The initial value is GL_FALSE. See glPolygonStipple.

GL_POST_COLOR_MATRIX_COLOR_TABLE

params returns a single boolean value indicating whether post color matrix transformation lookup is enabled. The initial value is GL_FALSE. See glColorTable.

GL_POST_COLOR_MATRIX_RED_BIAS

params returns one value, the red bias factor applied to RGBA fragments after color matrix transformations. The initial value is 0. See glPixelTransfer.

GL_POST_COLOR_MATRIX_GREEN_BIAS

params returns one value, the green bias factor applied to RGBA fragments after color matrix transformations. The initial value is 0. See glPixelTransfer.

GL_POST_COLOR_MATRIX_BLUE_BIAS

params returns one value, the blue bias factor applied to RGBA fragments after color matrix transformations. The initial value is 0. See glPixelTransfer.

GL_POST_COLOR_MATRIX_ALPHA_BIAS

params returns one value, the alpha bias factor applied to RGBA fragments after color matrix transformations. The initial value is 0. See glPixelTransfer.

GL_POST_COLOR_MATRIX_RED_SCALE

params returns one value, the red scale factor applied to RGBA fragments after color matrix transformations. The initial value is 1. See glPixelTransfer.

GL_POST_COLOR_MATRIX_GREEN_SCALE

params returns one value, the green scale factor applied to RGBA fragments after color matrix transformations. The initial value is 1. See glPixelTransfer.

GL_POST_COLOR_MATRIX_BLUE_SCALE

params returns one value, the blue scale factor applied to RGBA fragments after color matrix transformations. The initial value is 1. See glPixelTransfer.

GL_POST_COLOR_MATRIX_ALPHA_SCALE

params returns one value, the alpha scale factor applied to RGBA fragments after color matrix transformations. The initial value is 1. See glPixelTransfer.

GL_POST_CONVOLUTION_COLOR_TABLE

params returns a single boolean value indicating whether post convolution lookup is enabled. The initial value is GL_FALSE. See glColorTable.

GL_POST_CONVOLUTION_RED_BIAS

params returns one value, the red bias factor applied to RGBA fragments after convolution. The initial value is 0. See glPixelTransfer.

GL_POST_CONVOLUTION_GREEN_BIAS

params returns one value, the green bias factor applied to RGBA fragments after convolution. The initial value is 0. See glPixelTransfer.

GL_POST_CONVOLUTION_BLUE_BIAS

params returns one value, the blue bias factor applied to RGBA fragments after convolution. The initial value is 0. See glPixelTransfer.

GL_POST_CONVOLUTION_ALPHA_BIAS

params returns one value, the alpha bias factor applied to RGBA fragments after convolution. The initial value is 0. See glPixelTransfer.

GL_POST_CONVOLUTION_RED_SCALE

params returns one value, the red scale factor applied to RGBA fragments after convolution. The initial value is 1. See glPixelTransfer.

GL_POST_CONVOLUTION_GREEN_SCALE

params returns one value, the green scale factor applied to RGBA fragments after convolution. The initial value is 1. See glPixelTransfer.

GL_POST_CONVOLUTION_BLUE_SCALE

params returns one value, the blue scale factor applied to RGBA fragments after convolution. The initial value is 1. See glPixelTransfer.

GL_POST_CONVOLUTION_ALPHA_SCALE

params returns one value, the alpha scale factor applied to RGBA fragments after convolution. The initial value is 1. See glPixelTransfer.

GL_PROJECTION_MATRIX

params returns sixteen values: the projection matrix on the top of the projection matrix stack. Initially this matrix is the identity matrix. See glPushMatrix.

GL_PROJECTION_STACK_DEPTH

params returns one value, the number of matrices on the projection matrix stack. The initial value is 1. See glPushMatrix.

GL_READ_BUFFER

params returns one value, a symbolic constant indicating which color buffer is selected for reading. The initial value is GL_BACK if there is a back buffer, otherwise it is GL_FRONT. See glReadPixels and glAccum.

GL_RED_BIAS

params returns one value, the red bias factor used during pixel transfers. The initial value is 0.

GL_RED_BITS

params returns one value, the number of red bitplanes in each color buffer.

GL_RED_SCALE

params returns one value, the red scale factor used during pixel transfers. The initial value is 1. See glPixelTransfer.

GL_RENDER_MODE

params returns one value, a symbolic constant indicating whether the GL is in render, select, or feedback mode. The initial value is GL_RENDER. See glRenderMode.

GL_RESCALE_NORMAL

params returns single boolean value indicating whether normal rescaling is enabled. See glEnable.

GL_RGBA_MODE

params returns a single boolean value indicating whether the GL is in RGBA mode (true) or color index mode (false). See glColor.

GL_SAMPLE_BUFFERS

params returns a single integer value indicating the number of sample buffers associated with the framebuffer. See glSampleCoverage.

GL_SAMPLE_COVERAGE_VALUE

params returns a single positive floating-point value indicating the current sample coverage value. See glSampleCoverage.

GL_SAMPLE_COVERAGE_INVERT

params returns a single boolean value indicating if the temporary coverage value should be inverted. See glSampleCoverage.

GL_SAMPLES

params returns a single integer value indicating the coverage mask size. See glSampleCoverage.

GL_SCISSOR_BOX

params returns four values: the x and y window coordinates of the scissor box, followed by its width and height. Initially the x and y window coordinates are both 0 and the width and height are set to the size of the window. See glScissor.

GL_SCISSOR_TEST

params returns a single boolean value indicating whether scissoring is enabled. The initial value is GL_FALSE. See glScissor.

GL_SECONDARY_COLOR_ARRAY

params returns a single boolean value indicating whether the secondary color array is enabled. The initial value is GL_FALSE. See glSecondaryColorPointer.

GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING

params returns a single value, the name of the buffer object associated with the secondary color array. This buffer object would have been bound to the target GL_ARRAY_BUFFER at the time of the most recent call to glSecondaryColorPointer. If no buffer object was bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_SECONDARY_COLOR_ARRAY_SIZE

params returns one value, the number of components per color in the secondary color array. The initial value is 3. See glSecondaryColorPointer.

GL_SECONDARY_COLOR_ARRAY_STRIDE

params returns one value, the byte offset between consecutive colors in the secondary color array. The initial value is 0. See glSecondaryColorPointer.

GL_SECONDARY_COLOR_ARRAY_TYPE

params returns one value, the data type of each component in the secondary color array. The initial value is GL_FLOAT. See glSecondaryColorPointer.

GL_SELECTION_BUFFER_SIZE

params return one value, the size of the selection buffer. See glSelectBuffer.

GL_SEPARABLE_2D

params returns a single boolean value indicating whether 2D separable convolution is enabled. The initial value is GL_FALSE. See glSeparableFilter2D.

GL_SHADE_MODEL

params returns one value, a symbolic constant indicating whether the shading mode is flat or smooth. The initial value is GL_SMOOTH. See glShadeModel.

GL_SMOOTH_LINE_WIDTH_RANGE

params returns two values, the smallest and largest supported widths for antialiased lines. See glLineWidth.

GL_SMOOTH_LINE_WIDTH_GRANULARITY

params returns one value, the granularity of widths for antialiased lines. See glLineWidth.

GL_SMOOTH_POINT_SIZE_RANGE

params returns two values, the smallest and largest supported widths for antialiased points. See glPointSize.

GL_SMOOTH_POINT_SIZE_GRANULARITY

params returns one value, the granularity of sizes for antialiased points. See glPointSize.

GL_STENCIL_BACK_FAIL

params returns one value, a symbolic constant indicating what action is taken for back-facing polygons when the stencil test fails. The initial value is GL_KEEP. See glStencilOpSeparate.

GL_STENCIL_BACK_FUNC

params returns one value, a symbolic constant indicating what function is used for back-facing polygons to compare the stencil reference value with the stencil buffer value. The initial value is GL_ALWAYS. See glStencilFuncSeparate.

GL_STENCIL_BACK_PASS_DEPTH_FAIL

params returns one value, a symbolic constant indicating what action is taken for back-facing polygons when the stencil test passes, but the depth test fails. The initial value is GL_KEEP. See glStencilOpSeparate.

GL_STENCIL_BACK_PASS_DEPTH_PASS

params returns one value, a symbolic constant indicating what action is taken for back-facing polygons when the stencil test passes and the depth test passes. The initial value is GL_KEEP. See glStencilOpSeparate.

GL_STENCIL_BACK_REF

params returns one value, the reference value that is compared with the contents of the stencil buffer for back-facing polygons. The initial value is 0. See glStencilFuncSeparate.

GL_STENCIL_BACK_VALUE_MASK

params returns one value, the mask that is used for back-facing polygons to mask both the stencil reference value and the stencil buffer value before they are compared. The initial value is all 1’s. See glStencilFuncSeparate.

GL_STENCIL_BACK_WRITEMASK

params returns one value, the mask that controls writing of the stencil bitplanes for back-facing polygons. The initial value is all 1’s. See glStencilMaskSeparate.

GL_STENCIL_BITS

params returns one value, the number of bitplanes in the stencil buffer.

GL_STENCIL_CLEAR_VALUE

params returns one value, the index to which the stencil bitplanes are cleared. The initial value is 0. See glClearStencil.

GL_STENCIL_FAIL

params returns one value, a symbolic constant indicating what action is taken when the stencil test fails. The initial value is GL_KEEP. See glStencilOp. If the GL version is 2.0 or greater, this stencil state only affects non-polygons and front-facing polygons. Back-facing polygons use separate stencil state. See glStencilOpSeparate.

GL_STENCIL_FUNC

params returns one value, a symbolic constant indicating what function is used to compare the stencil reference value with the stencil buffer value. The initial value is GL_ALWAYS. See glStencilFunc. If the GL version is 2.0 or greater, this stencil state only affects non-polygons and front-facing polygons. Back-facing polygons use separate stencil state. See glStencilFuncSeparate.

GL_STENCIL_PASS_DEPTH_FAIL

params returns one value, a symbolic constant indicating what action is taken when the stencil test passes, but the depth test fails. The initial value is GL_KEEP. See glStencilOp. If the GL version is 2.0 or greater, this stencil state only affects non-polygons and front-facing polygons. Back-facing polygons use separate stencil state. See glStencilOpSeparate.

GL_STENCIL_PASS_DEPTH_PASS

params returns one value, a symbolic constant indicating what action is taken when the stencil test passes and the depth test passes. The initial value is GL_KEEP. See glStencilOp. If the GL version is 2.0 or greater, this stencil state only affects non-polygons and front-facing polygons. Back-facing polygons use separate stencil state. See glStencilOpSeparate.

GL_STENCIL_REF

params returns one value, the reference value that is compared with the contents of the stencil buffer. The initial value is 0. See glStencilFunc. If the GL version is 2.0 or greater, this stencil state only affects non-polygons and front-facing polygons. Back-facing polygons use separate stencil state. See glStencilFuncSeparate.

GL_STENCIL_TEST

params returns a single boolean value indicating whether stencil testing of fragments is enabled. The initial value is GL_FALSE. See glStencilFunc and glStencilOp.

GL_STENCIL_VALUE_MASK

params returns one value, the mask that is used to mask both the stencil reference value and the stencil buffer value before they are compared. The initial value is all 1’s. See glStencilFunc. If the GL version is 2.0 or greater, this stencil state only affects non-polygons and front-facing polygons. Back-facing polygons use separate stencil state. See glStencilFuncSeparate.

GL_STENCIL_WRITEMASK

params returns one value, the mask that controls writing of the stencil bitplanes. The initial value is all 1’s. See glStencilMask. If the GL version is 2.0 or greater, this stencil state only affects non-polygons and front-facing polygons. Back-facing polygons use separate stencil state. See glStencilMaskSeparate.

GL_STEREO

params returns a single boolean value indicating whether stereo buffers (left and right) are supported.

GL_SUBPIXEL_BITS

params returns one value, an estimate of the number of bits of subpixel resolution that are used to position rasterized geometry in window coordinates. The initial value is 4.

GL_TEXTURE_1D

params returns a single boolean value indicating whether 1D texture mapping is enabled. The initial value is GL_FALSE. See glTexImage1D.

GL_TEXTURE_BINDING_1D

params returns a single value, the name of the texture currently bound to the target GL_TEXTURE_1D. The initial value is 0. See glBindTexture.

GL_TEXTURE_2D

params returns a single boolean value indicating whether 2D texture mapping is enabled. The initial value is GL_FALSE. See glTexImage2D.

GL_TEXTURE_BINDING_2D

params returns a single value, the name of the texture currently bound to the target GL_TEXTURE_2D. The initial value is 0. See glBindTexture.

GL_TEXTURE_3D

params returns a single boolean value indicating whether 3D texture mapping is enabled. The initial value is GL_FALSE. See glTexImage3D.

GL_TEXTURE_BINDING_3D

params returns a single value, the name of the texture currently bound to the target GL_TEXTURE_3D. The initial value is 0. See glBindTexture.

GL_TEXTURE_BINDING_CUBE_MAP

params returns a single value, the name of the texture currently bound to the target GL_TEXTURE_CUBE_MAP. The initial value is 0. See glBindTexture.

GL_TEXTURE_COMPRESSION_HINT

params returns a single value indicating the mode of the texture compression hint. The initial value is GL_DONT_CARE.

GL_TEXTURE_COORD_ARRAY

params returns a single boolean value indicating whether the texture coordinate array is enabled. The initial value is GL_FALSE. See glTexCoordPointer.

GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING

params returns a single value, the name of the buffer object associated with the texture coordinate array. This buffer object would have been bound to the target GL_ARRAY_BUFFER at the time of the most recent call to glTexCoordPointer. If no buffer object was bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_TEXTURE_COORD_ARRAY_SIZE

params returns one value, the number of coordinates per element in the texture coordinate array. The initial value is 4. See glTexCoordPointer.

GL_TEXTURE_COORD_ARRAY_STRIDE

params returns one value, the byte offset between consecutive elements in the texture coordinate array. The initial value is 0. See glTexCoordPointer.

GL_TEXTURE_COORD_ARRAY_TYPE

params returns one value, the data type of the coordinates in the texture coordinate array. The initial value is GL_FLOAT. See glTexCoordPointer.

GL_TEXTURE_CUBE_MAP

params returns a single boolean value indicating whether cube-mapped texture coordinate generation is enabled. The initial value is GL_FALSE. See glTexGen.

GL_TEXTURE_GEN_Q

params returns a single boolean value indicating whether automatic generation of the q texture coordinate is enabled. The initial value is GL_FALSE. See glTexGen.

GL_TEXTURE_GEN_R

params returns a single boolean value indicating whether automatic generation of the r texture coordinate is enabled. The initial value is GL_FALSE. See glTexGen.

GL_TEXTURE_GEN_S

params returns a single boolean value indicating whether automatic generation of the S texture coordinate is enabled. The initial value is GL_FALSE. See glTexGen.

GL_TEXTURE_GEN_T

params returns a single boolean value indicating whether automatic generation of the T texture coordinate is enabled. The initial value is GL_FALSE. See glTexGen.

GL_TEXTURE_MATRIX

params returns sixteen values: the texture matrix on the top of the texture matrix stack. Initially this matrix is the identity matrix. See glPushMatrix.

GL_TEXTURE_STACK_DEPTH

params returns one value, the number of matrices on the texture matrix stack. The initial value is 1. See glPushMatrix.

GL_TRANSPOSE_COLOR_MATRIX

params returns 16 values, the elements of the color matrix in row-major order. See glLoadTransposeMatrix.

GL_TRANSPOSE_MODELVIEW_MATRIX

params returns 16 values, the elements of the modelview matrix in row-major order. See glLoadTransposeMatrix.

GL_TRANSPOSE_PROJECTION_MATRIX

params returns 16 values, the elements of the projection matrix in row-major order. See glLoadTransposeMatrix.

GL_TRANSPOSE_TEXTURE_MATRIX

params returns 16 values, the elements of the texture matrix in row-major order. See glLoadTransposeMatrix.

GL_UNPACK_ALIGNMENT

params returns one value, the byte alignment used for reading pixel data from memory. The initial value is 4. See glPixelStore.

GL_UNPACK_IMAGE_HEIGHT

params returns one value, the image height used for reading pixel data from memory. The initial is 0. See glPixelStore.

GL_UNPACK_LSB_FIRST

params returns a single boolean value indicating whether single-bit pixels being read from memory are read first from the least significant bit of each unsigned byte. The initial value is GL_FALSE. See glPixelStore.

GL_UNPACK_ROW_LENGTH

params returns one value, the row length used for reading pixel data from memory. The initial value is 0. See glPixelStore.

GL_UNPACK_SKIP_IMAGES

params returns one value, the number of pixel images skipped before the first pixel is read from memory. The initial value is 0. See glPixelStore.

GL_UNPACK_SKIP_PIXELS

params returns one value, the number of pixel locations skipped before the first pixel is read from memory. The initial value is 0. See glPixelStore.

GL_UNPACK_SKIP_ROWS

params returns one value, the number of rows of pixel locations skipped before the first pixel is read from memory. The initial value is 0. See glPixelStore.

GL_UNPACK_SWAP_BYTES

params returns a single boolean value indicating whether the bytes of two-byte and four-byte pixel indices and components are swapped after being read from memory. The initial value is GL_FALSE. See glPixelStore.

GL_VERTEX_ARRAY

params returns a single boolean value indicating whether the vertex array is enabled. The initial value is GL_FALSE. See glVertexPointer.

GL_VERTEX_ARRAY_BUFFER_BINDING

params returns a single value, the name of the buffer object associated with the vertex array. This buffer object would have been bound to the target GL_ARRAY_BUFFER at the time of the most recent call to glVertexPointer. If no buffer object was bound to this target, 0 is returned. The initial value is 0. See glBindBuffer.

GL_VERTEX_ARRAY_SIZE

params returns one value, the number of coordinates per vertex in the vertex array. The initial value is 4. See glVertexPointer.

GL_VERTEX_ARRAY_STRIDE

params returns one value, the byte offset between consecutive vertices in the vertex array. The initial value is 0. See glVertexPointer.

GL_VERTEX_ARRAY_TYPE

params returns one value, the data type of each coordinate in the vertex array. The initial value is GL_FLOAT. See glVertexPointer.

GL_VERTEX_PROGRAM_POINT_SIZE

params returns a single boolean value indicating whether vertex program point size mode is enabled. If enabled, and a vertex shader is active, then the point size is taken from the shader built-in gl_PointSize. If disabled, and a vertex shader is active, then the point size is taken from the point state as specified by glPointSize. The initial value is GL_FALSE.

GL_VERTEX_PROGRAM_TWO_SIDE

params returns a single boolean value indicating whether vertex program two-sided color mode is enabled. If enabled, and a vertex shader is active, then the GL chooses the back color output for back-facing polygons, and the front color output for non-polygons and front-facing polygons. If disabled, and a vertex shader is active, then the front color output is always selected. The initial value is GL_FALSE.

GL_VIEWPORT

params returns four values: the x and y window coordinates of the viewport, followed by its width and height. Initially the x and y window coordinates are both set to 0, and the width and height are set to the width and height of the window into which the GL will do its rendering. See glViewport.

GL_ZOOM_X

params returns one value, the x pixel zoom factor. The initial value is 1. See glPixelZoom.

GL_ZOOM_Y

params returns one value, the y pixel zoom factor. The initial value is 1. See glPixelZoom. Many of the boolean parameters can also be queried more easily using glIsEnabled.

Notes

GL_COLOR_LOGIC_OP, GL_COLOR_ARRAY, GL_COLOR_ARRAY_SIZE, GL_COLOR_ARRAY_STRIDE, GL_COLOR_ARRAY_TYPE, GL_EDGE_FLAG_ARRAY, GL_EDGE_FLAG_ARRAY_STRIDE, GL_INDEX_ARRAY, GL_INDEX_ARRAY_STRIDE, GL_INDEX_ARRAY_TYPE, GL_INDEX_LOGIC_OP, GL_NORMAL_ARRAY, GL_NORMAL_ARRAY_STRIDE, GL_NORMAL_ARRAY_TYPE, GL_POLYGON_OFFSET_UNITS, GL_POLYGON_OFFSET_FACTOR, GL_POLYGON_OFFSET_FILL, GL_POLYGON_OFFSET_LINE, GL_POLYGON_OFFSET_POINT, GL_TEXTURE_COORD_ARRAY, GL_TEXTURE_COORD_ARRAY_SIZE, GL_TEXTURE_COORD_ARRAY_STRIDE, GL_TEXTURE_COORD_ARRAY_TYPE, GL_VERTEX_ARRAY, GL_VERTEX_ARRAY_SIZE, GL_VERTEX_ARRAY_STRIDE, and GL_VERTEX_ARRAY_TYPE are available only if the GL version is 1.1 or greater.

GL_ALIASED_POINT_SIZE_RANGE, GL_FEEDBACK_BUFFER_SIZE, GL_FEEDBACK_BUFFER_TYPE, GL_LIGHT_MODEL_AMBIENT, GL_LIGHT_MODEL_COLOR_CONTROL, GL_MAX_3D_TEXTURE_SIZE, GL_MAX_ELEMENTS_INDICES, GL_MAX_ELEMENTS_VERTICES, GL_PACK_IMAGE_HEIGHT, GL_PACK_SKIP_IMAGES, GL_RESCALE_NORMAL, GL_SELECTION_BUFFER_SIZE, GL_SMOOTH_LINE_WIDTH_GRANULARITY, GL_SMOOTH_LINE_WIDTH_RANGE, GL_SMOOTH_POINT_SIZE_GRANULARITY, GL_SMOOTH_POINT_SIZE_RANGE, GL_TEXTURE_3D, GL_TEXTURE_BINDING_3D, GL_UNPACK_IMAGE_HEIGHT, and GL_UNPACK_SKIP_IMAGES are available only if the GL version is 1.2 or greater.

GL_COMPRESSED_TEXTURE_FORMATS, GL_NUM_COMPRESSED_TEXTURE_FORMATS, GL_TEXTURE_BINDING_CUBE_MAP, and GL_TEXTURE_COMPRESSION_HINT are available only if the GL version is 1.3 or greater.

GL_BLEND_DST_ALPHA, GL_BLEND_DST_RGB, GL_BLEND_SRC_ALPHA, GL_BLEND_SRC_RGB, GL_CURRENT_FOG_COORD, GL_CURRENT_SECONDARY_COLOR, GL_FOG_COORD_ARRAY_STRIDE, GL_FOG_COORD_ARRAY_TYPE, GL_FOG_COORD_SRC, GL_MAX_TEXTURE_LOD_BIAS,

GL_POINT_SIZE_MIN, GL_POINT_SIZE_MAX, GL_POINT_FADE_THRESHOLD_SIZE, GL_POINT_DISTANCE_ATTENUATION, GL_SECONDARY_COLOR_ARRAY_SIZE, GL_SECONDARY_COLOR_ARRAY_STRIDE, and GL_SECONDARY_COLOR_ARRAY_TYPE are available only if the GL version is 1.4 or greater.

GL_ARRAY_BUFFER_BINDING, GL_COLOR_ARRAY_BUFFER_BINDING, GL_EDGE_FLAG_ARRAY_BUFFER_BINDING, GL_ELEMENT_ARRAY_BUFFER_BINDING, GL_FOG_COORD_ARRAY_BUFFER_BINDING, GL_INDEX_ARRAY_BUFFER_BINDING, GL_NORMAL_ARRAY_BUFFER_BINDING, GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING, GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING, and GL_VERTEX_ARRAY_BUFFER_BINDING are available only if the GL version is 1.5 or greater.

GL_BLEND_EQUATION_ALPHA, GL_BLEND_EQUATION_RGB, GL_DRAW_BUFFERi, GL_FRAGMENT_SHADER_DERIVATIVE_HINT, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, GL_MAX_DRAW_BUFFERS, GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, GL_MAX_TEXTURE_COORDS, GL_MAX_TEXTURE_IMAGE_UNITS, GL_MAX_VARYING_FLOATS, GL_MAX_VERTEX_ATTRIBS, GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, GL_MAX_VERTEX_UNIFORM_COMPONENTS, GL_POINT_SPRITE, GL_STENCIL_BACK_FAIL, GL_STENCIL_BACK_FUNC, GL_STENCIL_BACK_PASS_DEPTH_FAIL, GL_STENCIL_BACK_PASS_DEPTH_PASS, GL_STENCIL_BACK_REF, GL_STENCIL_BACK_VALUE_MASK, GL_STENCIL_BACK_WRITEMASK, GL_VERTEX_PROGRAM_POINT_SIZE, and GL_VERTEX_PROGRAM_TWO_SIDE are available only if the GL version is 2.0 or greater.

GL_CURRENT_RASTER_SECONDARY_COLOR, GL_PIXEL_PACK_BUFFER_BINDING and GL_PIXEL_UNPACK_BUFFER_BINDING are available only if the GL version is 2.1 or greater.

GL_LINE_WIDTH_GRANULARITY was deprecated in GL version 1.2. Its functionality was replaced by GL_SMOOTH_LINE_WIDTH_GRANULARITY.

GL_LINE_WIDTH_RANGE was deprecated in GL version 1.2. Its functionality was replaced by GL_SMOOTH_LINE_WIDTH_RANGE.

GL_POINT_SIZE_GRANULARITY was deprecated in GL version 1.2. Its functionality was replaced by GL_SMOOTH_POINT_SIZE_GRANULARITY.

GL_POINT_SIZE_RANGE was deprecated in GL version 1.2. Its functionality was replaced by GL_SMOOTH_POINT_SIZE_RANGE.

GL_BLEND_EQUATION was deprecated in GL version 2.0. Its functionality was replaced by GL_BLEND_EQUATION_RGB and GL_BLEND_EQUATION_ALPHA.

GL_COLOR_MATRIX, GL_COLOR_MATRIX_STACK_DEPTH, GL_COLOR_TABLE, GL_CONVOLUTION_1D, GL_CONVOLUTION_2D, GL_HISTOGRAM, GL_MAX_COLOR_MATRIX_STACK_DEPTH, GL_MINMAX, GL_POST_COLOR_MATRIX_COLOR_TABLE, GL_POST_COLOR_MATRIX_RED_BIAS, GL_POST_COLOR_MATRIX_GREEN_BIAS, GL_POST_COLOR_MATRIX_BLUE_BIAS, GL_POST_COLOR_MATRIX_ALPHA_BIAS, GL_POST_COLOR_MATRIX_RED_SCALE, GL_POST_COLOR_MATRIX_GREEN_SCALE, GL_POST_COLOR_MATRIX_BLUE_SCALE, GL_POST_COLOR_MATRIX_ALPHA_SCALE, GL_POST_CONVOLUTION_COLOR_TABLE, GL_POST_CONVOLUTION_RED_BIAS, GL_POST_CONVOLUTION_GREEN_BIAS, GL_POST_CONVOLUTION_BLUE_BIAS, GL_POST_CONVOLUTION_ALPHA_BIAS, GL_POST_CONVOLUTION_RED_SCALE, GL_POST_CONVOLUTION_GREEN_SCALE, GL_POST_CONVOLUTION_BLUE_SCALE, GL_POST_CONVOLUTION_ALPHA_SCALE, and GL_SEPARABLE_2D are available only if ARB_imaging is returned from glGet when called with the argument GL_EXTENSIONS.

When the ARB_multitexture extension is supported, or the GL version is 1.3 or greater, the following parameters return the associated value for the active texture unit: GL_CURRENT_RASTER_TEXTURE_COORDS, GL_TEXTURE_1D, GL_TEXTURE_BINDING_1D, GL_TEXTURE_2D, GL_TEXTURE_BINDING_2D, GL_TEXTURE_3D, GL_TEXTURE_BINDING_3D, GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R, GL_TEXTURE_GEN_Q, GL_TEXTURE_MATRIX, and GL_TEXTURE_STACK_DEPTH. Likewise, the following parameters return the associated value for the active client texture unit: GL_TEXTURE_COORD_ARRAY, GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING, GL_TEXTURE_COORD_ARRAY_SIZE, GL_TEXTURE_COORD_ARRAY_STRIDE, GL_TEXTURE_COORD_ARRAY_TYPE.

Errors

GL_INVALID_ENUM is generated if pname is not an accepted value.

GL_INVALID_OPERATION is generated if glGet is executed between the execution of glBegin and the corresponding execution of glEnd.

See Also

glGetActiveAttrib, glGetActiveUniform, glGetAttachedShaders, glGetAttribLocation, glGetBufferParameteriv, glGetBufferPointerv, glGetBufferSubData, glGetClipPlane, glGetColorTable, glGetColorTableParameter, glGetCompressedTexImage, glGetConvolutionFilter, glGetConvolutionParameter, glGetError, glGetHistogram, glGetHistogramParameter, glGetLight, glGetMap, glGetMaterial, glGetMinmax, glGetMinmaxParameter, glGetPixelMap, glGetPointerv, glGetPolygonStipple, glGetProgram, glGetProgramInfoLog, glGetQueryiv, glGetQueryObject, glGetSeparableFilter, glGetShader, glGetShaderInfoLog, glGetShaderSource, glGetString, glGetTexEnv, glGetTexGen, glGetTexImage, glGetTexLevelParameter, glGetTexParameter, glGetUniform, glGetUniformLocation, glGetVertexAttrib, glGetVertexAttribPointerv, glIsEnabled

glGetActiveAttrib

Return information about an active attribute variable for the specified program object

C Specification

void glGetActiveAttrib(GLuint    program,
                                     GLuint    index,
                                     GLsizei   bufSize,
                                     GLsizei * length,
                                     GLint *   size,
                                     GLenum *  type,
                                     GLchar *  name);

Parameters

Image

Description

glGetActiveAttrib returns information about an active attribute variable in the program object specified by program. The number of active attributes can be obtained by calling glGetProgram with the value GL_ACTIVE_ATTRIBUTES. A value of 0 for index selects the first active attribute variable. Permissible values for index range from 0 to the number of active attribute variables minus 1.

A vertex shader may use either built-in attribute variables, user-defined attribute variables, or both. Built-in attribute variables have a prefix of “gl_” and reference conventional OpenGL vertex attribtes (e.g., gl_Vertex, gl_Normal, etc., see the OpenGL Shading Language specification for a complete list.) User-defined attribute variables have arbitrary names and obtain their values through numbered generic vertex attributes. An attribute variable (either built-in or user-defined) is considered active if it is determined during the link operation that it may be accessed during program execution. Therefore, program should have previously been the target of a call to glLinkProgram, but it is not necessary for it to have been linked successfully.

The size of the character buffer required to store the longest attribute variable name in program can be obtained by calling glGetProgram with the value GL_ACTIVE_ATTRIBUTE_MAX_LENGTH. This value should be used to allocate a buffer of sufficient size to store the returned attribute name. The size of this character buffer is passed in bufSize, and a pointer to this character buffer is passed in name.

glGetActiveAttrib returns the name of the attribute variable indicated by index, storing it in the character buffer specified by name. The string returned will be null terminated. The actual number of characters written into this buffer is returned in length, and this count does not include the null termination character. If the length of the returned string is not required, a value of NULL can be passed in the length argument.

The type argument will return a pointer to the attribute variable’s data type. The symbolic constants GL_FLOAT, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4, GL_FLOAT_MAT2, GL_FLOAT_MAT3, GL_FLOAT_MAT4, GL_FLOAT_MAT2x3, GL_FLOAT_MAT2x4, GL_FLOAT_MAT3x2, GL_FLOAT_MAT3x4, GL_FLOAT_MAT4x2, or GL_FLOAT_MAT4x3 may be returned. The size argument will return the size of the attribute, in units of the type returned in type.

The list of active attribute variables may include both built-in attribute variables (which begin with the prefix “gl_”) as well as user-defined attribute variable names.

This function will return as much information as it can about the specified active attribute variable. If no information is available, length will be 0, and name will be an empty string. This situation could occur if this function is called after a link operation that failed. If an error occurs, the return values length, size, type, and name will be unmodified.

Notes

glGetActiveAttrib is available only if the GL version is 2.0 or greater.

GL_FLOAT_MAT2x3, GL_FLOAT_MAT2x4, GL_FLOAT_MAT3x2, GL_FLOAT_MAT3x4, GL_FLOAT_MAT4x2, and GL_FLOAT_MAT4x3 will only be returned as a type if the GL version is 2.1 or greater.

Errors

GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.

GL_INVALID_OPERATION is generated if program is not a program object.

GL_INVALID_VALUE is generated if index is greater than or equal to the number of active attribute variables in program.

GL_INVALID_OPERATION is generated if glGetActiveAttrib is executed between the execution of glBegin and the corresponding execution of glEnd.

GL_INVALID_VALUE is generated if bufSize is less than 0.

Associated Gets

glGet with argument GL_MAX_VERTEX_ATTRIBS.

glGetProgram with argument GL_ACTIVE_ATTRIBUTES or GL_ACTIVE_ATTRIBUTE_MAX_LENGTH.

glIsProgram

See Also

glBindAttribLocation, glLinkProgram, glVertexAttrib, glVertexAttribPointer

glGetActiveUniform

Return information about an active uniform variable for the specified program object

C Specification

void glGetActiveUniform(GLuint    program,
                                      GLuint    index,
                                      GLsizei   bufSize,
                                      GLsizei * length,
                                      GLint *   size,
                                      GLenum *  type,
                                      GLchar *  name);

Parameters

Image

Description

glGetActiveUniform returns information about an active uniform variable in the program object specified by program. The number of active uniform variables can be obtained by calling glGetProgram with the value GL_ACTIVE_UNIFORMS. A value of 0 for index selects the first active uniform variable. Permissible values for index range from 0 to the number of active uniform variables minus 1.

Shaders may use either built-in uniform variables, user-defined uniform variables, or both. Builtin uniform variables have a prefix of “gl_” and reference existing OpenGL state or values derived from such state (e.g., gl_Fog, gl_ModelViewMatrix, etc., see the OpenGL Shading Language specification for a complete list.) User-defined uniform variables have arbitrary names and obtain their values from the application through calls to glUniform. A uniform variable (either built-in or user-defined) is considered active if it is determined during the link operation that it may be accessed during program execution. Therefore, program should have previously been the target of a call to glLinkProgram, but it is not necessary for it to have been linked successfully.

The size of the character buffer required to store the longest uniform variable name in program can be obtained by calling glGetProgram with the value GL_ACTIVE_UNIFORM_MAX_LENGTH. This value should be used to allocate a buffer of sufficient size to store the returned uniform variable name. The size of this character buffer is passed in bufSize, and a pointer to this character buffer is passed in name.

glGetActiveUniform returns the name of the uniform variable indicated by index, storing it in the character buffer specified by name. The string returned will be null terminated. The actual number of characters written into this buffer is returned in length, and this count does not include the null termination character. If the length of the returned string is not required, a value of NULL can be passed in the length argument.

The type argument will return a pointer to the uniform variable’s data type. The symbolic constants GL_FLOAT, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4, GL_INT, GL_INT_VEC2, GL_INT_VEC3, GL_INT_VEC4, GL_BOOL, GL_BOOL_VEC2, GL_BOOL_VEC3, GL_BOOL_VEC4, GL_FLOAT_MAT2, GL_FLOAT_MAT3, GL_FLOAT_MAT4, GL_FLOAT_MAT2x3, GL_FLOAT_MAT2x4, GL_FLOAT_MAT3x2, GL_FLOAT_MAT3x4, GL_FLOAT_MAT4x2, GL_FLOAT_MAT4x3, GL_SAMPLER_1D, GL_SAMPLER_2D, GL_SAMPLER_3D, GL_SAMPLER_CUBE, GL_SAMPLER_1D_SHADOW, or GL_SAMPLER_2D_SHADOW may be returned.

If one or more elements of an array are active, the name of the array is returned in name, the type is returned in type, and the size parameter returns the highest array element index used, plus one, as determined by the compiler and/or linker. Only one active uniform variable will be reported for a uniform array.

Uniform variables that are declared as structures or arrays of structures will not be returned directly by this function. Instead, each of these uniform variables will be reduced to its fundamental components containing the “.” and “[]” operators such that each of the names is valid as an argument to glGetUniformLocation. Each of these reduced uniform variables is counted as one active uniform variable and is assigned an index. A valid name cannot be a structure, an array of structures, or a subcomponent of a vector or matrix.

The size of the uniform variable will be returned in size. Uniform variables other than arrays will have a size of 1. Structures and arrays of structures will be reduced as described earlier, such that each of the names returned will be a data type in the earlier list. If this reduction results in an array, the size returned will be as described for uniform arrays; otherwise, the size returned will be 1.

The list of active uniform variables may include both built-in uniform variables (which begin with the prefix “gl_”) as well as user-defined uniform variable names.

This function will return as much information as it can about the specified active uniform variable. If no information is available, length will be 0, and name will be an empty string. This situation could occur if this function is called after a link operation that failed. If an error occurs, the return values length, size, type, and name will be unmodified.

Notes

glGetActiveUniform is available only if the GL version is 2.0 or greater.

GL_FLOAT_MAT2x3, GL_FLOAT_MAT2x4, GL_FLOAT_MAT3x2, GL_FLOAT_MAT3x4, GL_FLOAT_MAT4x2, and GL_FLOAT_MAT4x3 will only be returned as a type if the GL version is 2.1 or greater.

Errors

GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.

GL_INVALID_OPERATION is generated if program is not a program object.

GL_INVALID_VALUE is generated if index is greater than or equal to the number of active uniform variables in program.

GL_INVALID_OPERATION is generated if glGetActiveUniform is executed between the execution of glBegin and the corresponding execution of glEnd.

GL_INVALID_VALUE is generated if bufSize is less than 0.

Associated Gets

glGet with argument GL_MAX_VERTEX_UNIFORM_COMPONENTS or GL_MAX_FRAGMENT_UNIFORM_COMPONENTS.

glGetProgram with argument GL_ACTIVE_UNIFORMS or GL_ACTIVE_UNIFORM_MAX_LENGTH.

glIsProgram

See Also

glGetUniform, glGetUniformLocation, glLinkProgram, glUniform, glUseProgram

glGetAttachedShaders

Return the handles of the shader objects attached to a program object

C Specification

void glGetAttachedShaders(GLuint    program,
                                            GLsizei   maxCount,
                                            GLsizei * count,
                                            GLuint *  shaders);

Parameters

Image

Description

glGetAttachedShaders returns the names of the shader objects attached to program. The names of shader objects that are attached to program will be returned in shaders. The actual number of shader names written into shaders is returned in count. If no shader objects are attached to program, count is set to 0. The maximum number of shader names that may be returned in shaders is specified by maxCount.

If the number of names actually returned is not required (for instance, if it has just been obtained by calling glGetProgram), a value of NULL may be passed for count. If no shader objects are attached to program, a value of 0 will be returned in count. The actual number of attached shaders can be obtained by calling glGetProgram with the value GL_ATTACHED_SHADERS.

Notes

glGetAttachedShaders is available only if the GL version is 2.0 or greater.

Errors

GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.

GL_INVALID_OPERATION is generated if program is not a program object.

GL_INVALID_VALUE is generated if maxCount is less than 0.

GL_INVALID_OPERATION is generated if glGetAttachedShaders is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGetProgram with argument GL_ATTACHED_SHADERS

glIsProgram

See Also

glAttachShader, glDetachShader

glGetAttribLocation

Return the location of an attribute variable

C Specification

GLint glGetAttribLocation(GLuint         program,
                                           const GLchar * name);

Parameters

Image

Description

glGetAttribLocation queries the previously linked program object specified by program for the attribute variable specified by name and returns the index of the generic vertex attribute that is bound to that attribute variable. If name is a matrix attribute variable, the index of the first column of the matrix is returned. If the named attribute variable is not an active attribute in the specified program object or if name starts with the reserved prefix “gl_”, a value of -1 is returned.

The association between an attribute variable name and a generic attribute index can be specified at any time by calling glBindAttribLocation. Attribute bindings do not go into effect until glLinkProgram is called. After a program object has been linked successfully, the index values for attribute variables remain fixed until the next link command occurs. The attribute values can only be queried after a link if the link was successful. glGetAttribLocation returns the binding that actually went into effect the last time glLinkProgram was called for the specified program object. Attribute bindings that have been specified since the last link operation are not returned by glGetAttribLocation.

Notes

glGetAttribLocation is available only if the GL version is 2.0 or greater.

Errors

GL_INVALID_OPERATION is generated if program is not a value generated by OpenGL.

GL_INVALID_OPERATION is generated if program is not a program object.

GL_INVALID_OPERATION is generated if program has not been successfully linked.

GL_INVALID_OPERATION is generated if glGetAttribLocation is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGetActiveAttrib with argument program and the index of an active attribute glIsProgram

See Also

glBindAttribLocation, glLinkProgram, glVertexAttrib, glVertexAttribPointer

glGetBufferParameteriv

Return parameters of a buffer object

C Specification

void glGetBufferParameteriv(GLenum  target,
                                              GLenum  value,
                                              GLint * data);

Parameters

Image

Description

glGetBufferParameteriv returns in data a selected parameter of the buffer object specified by target.

value names a specific buffer object parameter, as follows:

GL_BUFFER_ACCESS

params returns the access policy set while mapping the buffer object. The initial value is GL_READ_WRITE.

GL_BUFFER_MAPPED

params returns a flag indicating whether the buffer object is currently mapped. The initial value is GL_FALSE.

GL_BUFFER_SIZE

params returns the size of the buffer object, measured in bytes. The initial value is 0.

GL_BUFFER_USAGE

params returns the buffer object’s usage pattern. The initial value is GL_STATIC_DRAW.

Notes

If an error is generated, no change is made to the contents of data.

glGetBufferParameteriv is available only if the GL version is 1.5 or greater.

Targets GL_PIXEL_PACK_BUFFER and GL_PIXEL_UNPACK_BUFFER are available only if the GL version is 2.1 or greater.

Errors

GL_INVALID_ENUM is generated if target or value is not an accepted value.

GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.

GL_INVALID_OPERATION is generated if glGetBufferParameteriv is executed between the execution of glBegin and the corresponding execution of glEnd.

See Also

glBindBuffer, glBufferData, glMapBuffer, glUnmapBuffer

glGetBufferPointerv

Return the pointer to a mapped buffer object’s data store

C Specification

void glGetBufferPointerv(GLenum    target,
                                         GLenum    pname,
                                         GLvoid ** params);

Parameters

Image

Description

glGetBufferPointerv returns pointer information. pname is a symbolic constant indicating the pointer to be returned, which must be GL_BUFFER_MAP_POINTER, the pointer to which the buffer object’s data store is mapped. If the data store is not currently mapped, NULL is returned. params is a pointer to a location in which to place the returned pointer value.

Notes

If an error is generated, no change is made to the contents of params.

glGetBufferPointerv is available only if the GL version is 1.5 or greater.

Targets GL_PIXEL_PACK_BUFFER and GL_PIXEL_UNPACK_BUFFER are available only if the GL version is 2.1 or greater.

The initial value for the pointer is NULL.

Errors

GL_INVALID_ENUM is generated if target or pname is not an accepted value.

GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.

GL_INVALID_OPERATION is generated if glGetBufferParameteriv is executed between the execution of glBegin and the corresponding execution of glEnd.

See Also

glBindBuffer, glMapBuffer

glGetBufferSubData

Return a subset of a buffer object’s data store

C Specification

void glGetBufferSubData(GLenum     target,
                                         GLintptr   offset,
                                         GLsizeiptr size,
                                         GLvoid *   data);

Parameters

Image

Description

glGetBufferSubData returns some or all of the data from the buffer object currently bound to target. Data starting at byte offset offset and extending for size bytes is copied from the data store to the memory pointed to by data. An error is thrown if the buffer object is currently mapped, or if offset and size together define a range beyond the bounds of the buffer object’s data store.

Notes

If an error is generated, no change is made to the contents of data.

glGetBufferSubData is available only if the GL version is 1.5 or greater.

Targets GL_PIXEL_PACK_BUFFER and GL_PIXEL_UNPACK_BUFFER are available only if the GL version is 2.1 or greater.

Errors

GL_INVALID_ENUM is generated if target is not GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER, GL_PIXEL_PACK_BUFFER, or GL_PIXEL_UNPACK_BUFFER.

GL_INVALID_VALUE is generated if offset or size is negative, or if together they define a region of memory that extends beyond the buffer object’s allocated data store.

GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.

GL_INVALID_OPERATION is generated if the buffer object being queried is mapped.

GL_INVALID_OPERATION is generated if glGetBufferSubData is executed between the execution of glBegin and the corresponding execution of glEnd.

See Also

glBindBuffer, glBufferData, glBufferSubData, glMapBuffer, glUnmapBuffer

glGetClipPlane

Return the coefficients of the specified clipping plane

C Specification

void glGetClipPlane(GLenum     plane,
                               GLdouble * equation);

Parameters

Image

Description

glGetClipPlane returns in equation the four coefficients of the plane equation for plane.

Notes

It is always the case that GL_CLIP_PLANEi = GL_CLIP_PLANE0 + i.

If an error is generated, no change is made to the contents of equation.

Errors

GL_INVALID_ENUM is generated if plane is not an accepted value.

GL_INVALID_OPERATION is generated if glGetClipPlane is executed between the execution of glBegin and the corresponding execution of glEnd.

See Also

glClipPlane

glGetColorTable

Retrieve contents of a color lookup table

C Specification

void glGetColorTable(GLenum   target,
                                 GLenum   format,
                                 GLenum   type,
                                 GLvoid * table);

Parameters

Image

Description

glGetColorTable returns in table the contents of the color table specified by target. No pixel transfer operations are performed, but pixel storage modes that are applicable to glReadPixels are performed.

If a nonzero named buffer object is bound to the GL_PIXEL_PACK_BUFFER target (see glBindBuffer) while a histogram table is requested, table is treated as a byte offset into the buffer object’s data store.

Color components that are requested in the specified format, but which are not included in the internal format of the color lookup table, are returned as zero. The assignments of internal color components to the components requested by format are

Image

Notes

glGetColorTable is present only if ARB_imaging is returned when glGetString is called with an argument of GL_EXTENSIONS.

Errors

GL_INVALID_ENUM is generated if target is not one of the allowable values.

GL_INVALID_ENUM is generated if format is not one of the allowable values.

GL_INVALID_ENUM is generated if type is not one of the allowable values.

GL_INVALID_OPERATION is generated if type is one of GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, or GL_UNSIGNED_SHORT_5_6_5_REV and format is not GL_RGB.

GL_INVALID_OPERATION is generated if type is one of GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, or GL_UNSIGNED_INT_2_10_10_10_REV and format is neither GL_RGBA nor GL_BGRA.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to the GL_PIXEL_PACK_BUFFER target and the buffer object’s data store is currently mapped.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to the GL_PIXEL_PACK_BUFFER target and the data would be packed to the buffer object such that the memory writes required would exceed the data store size.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to the GL_PIXEL_PACK_BUFFER target and table is not evenly divisible into the number of bytes needed to store in memory a datum indicated by type.

GL_INVALID_OPERATION is generated if glGetColorTable is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGetColorTableParameter

glGet with argument GL_PIXEL_PACK_BUFFER_BINDING

See Also

glColorTable, glColorTableParameter

glGetColorTableParameter

Get color lookup table parameters

C Specification

void glGetColorTableParameterfv(GLenum    target,
                                                         GLenum    pname,
                                                         GLfloat * params);
void glGetColorTableParameteriv(GLenum    target,
                                                         GLenum    pname,
                                                         GLint *   params);

Parameters

Image

Description

Returns parameters specific to color table target.

When pname is set to GL_COLOR_TABLE_SCALE or GL_COLOR_TABLE_BIAS, glGetColorTableParameter returns the color table scale or bias parameters for the table specified by target. For these queries, target must be set to GL_COLOR_TABLE, GL_POST_CONVOLUTION_COLOR_TABLE, or GL_POST_COLOR_MATRIX_COLOR_TABLE and params points to an array of four elements, which receive the scale or bias factors for red, green, blue, and alpha, in that order.

glGetColorTableParameter can also be used to retrieve the format and size parameters for a color table. For these queries, set target to either the color table target or the proxy color table target. The format and size parameters are set by glColorTable.

The following table lists the format and size parameters that may be queried. For each symbolic constant listed below for pname, params must point to an array of the given length and receive the values indicated.

Image

Notes

glGetColorTableParameter is present only if ARB_imaging is returned when glGetString is called with an argument of GL_EXTENSIONS.

Errors

GL_INVALID_ENUM is generated if target or pname is not an acceptable value.

GL_INVALID_OPERATION is generated if glGetColorTableParameter is executed between the execution of glBegin and the corresponding execution of glEnd.

See Also

glColorTable, glTexParameter, glColorTableParameter

glGetCompressedTexImage

Return a compressed texture image

C Specification

void glGetCompressedTexImage(GLenum   target,
                                                      GLint    lod,
                                                      GLvoid * img);

Parameters

Image

Description

glGetCompressedTexImage returns the compressed texture image associated with target and lod into img. img should be an array of GL_TEXTURE_COMPRESSED_IMAGE_SIZE bytes. target specifies whether the desired texture image was one specified by glTexImage1D (GL_TEXTURE_1D), glTexImage2D (GL_TEXTURE_2D or any of GL_TEXTURE_CUBE_MAP_*), or glTexImage3D (GL_TEXTURE_3D). lod specifies the level-of-detail number of the desired image.

If a nonzero named buffer object is bound to the GL_PIXEL_PACK_BUFFER target (see glBindBuffer) while a texture image is requested, img is treated as a byte offset into the buffer object’s data store.

To minimize errors, first verify that the texture is compressed by calling glGetTexLevelParameter with argument GL_TEXTURE_COMPRESSED. If the texture is compressed, then determine the amount of memory required to store the compressed texture by calling glGetTexLevelParameter with argument GL_TEXTURE_COMPRESSED_IMAGE_SIZE. Finally, retrieve the internal format of the texture by calling glGetTexLevelParameter with argument GL_TEXTURE_INTERNAL_FORMAT. To store the texture for later use, associate the internal format and size with the retrieved texture image. These data can be used by the respective texture or subtexture loading routine used for loading target textures.

Notes

glGetCompressedTexImage is available only if the GL version is 1.3 or greater.

Errors

GL_INVALID_VALUE is generated if lod is less than zero or greater than the maximum number of LODs permitted by the implementation.

GL_INVALID_OPERATION is generated if glGetCompressedTexImage is used to retrieve a texture that is in an uncompressed internal format.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to the GL_PIXEL_PACK_BUFFER target and the buffer object’s data store is currently mapped.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to the GL_PIXEL_PACK_BUFFER target and the data would be packed to the buffer object such that the memory writes required would exceed the data store size.

GL_INVALID_OPERATION is generated if glGetCompressedTexImage is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGetTexLevelParameter with argument GL_TEXTURE_COMPRESSED

glGetTexLevelParameter with argument GL_TEXTURE_COMPRESSED_IMAGE_SIZE

glGetTexLevelParameter with argument GL_TEXTURE_INTERNAL_FORMAT

glGet with argument GL_PIXEL_PACK_BUFFER_BINDING

See Also

glActiveTexture, glCompressedTexImage1D, glCompressedTexImage2D, glCompressedTexImage3D, glCompressedTexSubImage1D, glCompressedTexSubImage2D, glCompressedTexSubImage3D, glDrawPixels, glReadPixels, glTexEnv, glTexGen, glTexImage1D, glTexImage2D, glTexImage3D, glTexParameter, glTexSubImage1D, glTexSubImage2D, glTexSubImage3D

glGetConvolutionFilter

Get current 1D or 2D convolution filter kernel

C Specification

void glGetConvolutionFilter(GLenum   target,
                                             GLenum   format,
                                             GLenum   type,
                                             GLvoid * image);

Parameters

Image

Description

glGetConvolutionFilter returns the current 1D or 2D convolution filter kernel as an image. The one- or two-dimensional image is placed in image according to the specifications in format and type. No pixel transfer operations are performed on this image, but the relevant pixel storage modes are applied.

If a nonzero named buffer object is bound to the GL_PIXEL_PACK_BUFFER target (see glBindBuffer) while a convolution filter is requested, image is treated as a byte offset into the buffer object’s data store.

Color components that are present in format but not included in the internal format of the filter are returned as zero. The assignments of internal color components to the components of format are as follows.

Image

Notes

glGetConvolutionFilter is present only if ARB_imaging is returned when glGetString is called with an argument of GL_EXTENSIONS.

The current separable 2D filter must be retrieved with glGetSeparableFilter rather than glGetConvolutionFilter.

Errors

GL_INVALID_ENUM is generated if target is not one of the allowable values.

GL_INVALID_ENUM is generated if format is not one of the allowable values.

GL_INVALID_ENUM is generated if type is not one of the allowable values.

GL_INVALID_OPERATION is generated if type is one of GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, or GL_UNSIGNED_SHORT_5_6_5_REV and format is not GL_RGB.

GL_INVALID_OPERATION is generated if type is one of GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, or GL_UNSIGNED_INT_2_10_10_10_REV and format is neither GL_RGBA nor GL_BGRA.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to the GL_PIXEL_PACK_BUFFER target and the buffer object’s data store is currently mapped.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to the GL_PIXEL_PACK_BUFFER target and the data would be packed to the buffer object such that the memory writes required would exceed the data store size.

GL_INVALID_OPERATION is generated if a nonzero buffer object name is bound to the GL_PIXEL_PACK_BUFFER target and image is not evenly divisible into the number of bytes needed to store in memory a datum indicated by type.

GL_INVALID_OPERATION is generated if glGetConvolutionFilter is executed between the execution of glBegin and the corresponding execution of glEnd.

Associated Gets

glGetConvolutionParameter

glGet with argument GL_PIXEL_PACK_BUFFER_BINDING

See Also

glGetSeparableFilter, glConvolutionParameter, glConvolutionFilter1D, glConvolutionFilter2D

glGetConvolutionParameter

Get convolution parameters

C Specification

void glGetConvolutionParameterfv(GLenum    target,
                                                           GLenum    pname,
                                                           GLfloat * params);
void glGetConvolutionParameteriv(GLenum  target,
                                                           GLenum  pname,
                                                           GLint * params);

Parameters

Image

Description

glGetConvolutionParameter retrieves convolution parameters. target determines which convolution filter is queried. pname determines which parameter is returned:

GL_CONVOLUTION_BORDER_MODE

The convolution border mode. See glConvolutionParameter for a list of border modes. GL_CONVOLUTION_BORDER_COLOR The current convolution border color. params must be a pointer to an array of four elements, which will receive the red, green, blue, and alpha border colors.

GL_CONVOLUTION_FILTER_SCALE

The current filter scale factors. params must be a pointer to an array of four elements, which will receive the red, green, blue, and alpha filter scale factors in that order.

GL_CONVOLUTION_FILTER_BIAS

The current filter bias factors. params must be a pointer to an array of four elements, which will receive the red, green, blue, and alpha filter bias terms in that order.

GL_CONVOLUTION_FORMAT

The current internal format. See glConvolutionFilter1D, glConvolutionFilter2D, and glSeparableFilter2D for lists of allowable formats.

GL_CONVOLUTION_WIDTH

The current filter image width.

GL_CONVOLUTION_HEIGHT

The current filter image height.

GL_MAX_CONVOLUTION_WIDTH

The maximum acceptable filter image width.

GL_MAX_CONVOLUTION_HEIGHT

The maximum acceptable filter image height.

Errors

GL_INVALID_ENUM is generated if target is not one of the allowable values.

GL_INVALID_ENUM is generated if pname is not one of the allowable values.

GL_INVALID_ENUM is generated if target is GL_CONVOLUTION_1D and pname is GL_CONVOLUTION_HEIGHT or GL_MAX_CONVOLUTION_HEIGHT.

GL_INVALID_OPERATION is generated if glGetConvolutionParameter is executed between the execution of glBegin and the corresponding execution of glEnd.

See Also

glGetConvolutionFilter, glGetSeparableFilter, glConvolutionParameter

glGetError

Return error information

C Specification

GLenum glGetError(void);

Description

glGetError returns the value of the error flag. Each detectable error is assigned a numeric code and symbolic name. When an error occurs, the error flag is set to the appropriate error code value. No other errors are recorded until glGetError is called, the error code is returned, and the flag is reset to GL_NO_ERROR. If a call to glGetError returns GL_NO_ERROR, there has been no detectable error since the last call to glGetError, or since the GL was initialized.

To allow for distributed implementations, there may be several error flags. If any single error flag has recorded an error, the value of that flag is returned and that flag is reset to GL_NO_ERROR when glGetError is called. If more than one flag has recorded an error, glGetError returns and clears an arbitrary error flag value. Thus, glGetError should always be called in a loop, until it returns GL_NO_ERROR, if all error flags are to be reset.

Initially, all error flags are set to GL_NO_ERROR.

The following errors are currently defined:

GL_NO_ERROR

No error has been recorded. The value of this symbolic constant is guaranteed to be 0.

GL_INVALID_ENUM

An unacceptable value is specified for an enumerated argument. The offending command is ignored and has no other side effect than to set the error flag.

GL_INVALID_VALUE

A numeric argument is out of range. The offending command is ignored and has no other side effect than to set the error flag.

GL_INVALID_OPERATION

The specified operation is not allowed in the current state. The offending command is ignored and has no other side effect than to set the error flag.

GL_STACK_OVERFLOW

This command would cause a stack overflow. The offending command is ignored and has no other side effect than to set the error flag.

GL_STACK_UNDERFLOW

This command would cause a stack underflow. The offending command is ignored and has no other side effect than to set the error flag.

GL_OUT_OF_MEMORY

There is not enough memory left to execute the command. The state of the GL is undefined, except for the state of the error flags, after this error is recorded.

GL_TABLE_TOO_LARGE

The specified table exceeds the implementation’s maximum supported table size. The offending command is ignored and has no other side effect than to set the error flag.

When an error flag is set, results of a GL operation are undefined only if GL_OUT_OF_MEMORY has occurred. In all other cases, the command generating the error is ignored and has no effect on the GL state or frame buffer contents. If the generating command returns a value, it returns 0. If glGetError itself generates an error, it returns 0.

Notes

GL_TABLE_TOO_LARGE was introduced in GL version 1.2.

Errors

GL_INVALID_OPERATION is generated if glGetError is executed between the execution of glBegin and the corresponding execution of glEnd. In this case, glGetError returns 0.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset