Name

glGetBooleanv, glGetFixedv, glGetFloatv, glGetIntegerv - return the value or values of a selected parameter

C Specification

void glGetBooleanv(GLenum pname, GLboolean * params)
void glGetFixedv(GLenum pname, GLfixed * params)
void glGetFloatv(GLenum pname, GLfloat * params)
void glGetIntegerv(GLenum pname, GLint * params)

Parameters

pname

Specifies the parameter value to be returned. The symbolic constants in the list below are accepted.

params

Returns the value or values of the specified parameter.

Description

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

If a Get command is issued that returns value types different from the type of the value being obtained, a type conversion is performed. If GetBooleanv is called, a floating-point or integer value converts to GL_FALSE if and only if it is zero (otherwise it converts to GL_TRUE). If GetIntegerv is called, a boolean value is interpreted as either 1 or 0, and a floating-point value is rounded to the nearest integer, unless the value is an RGBA color component, a DepthRange value, a depth buffer clear value, or a normal coordinate. In these cases, the Get command does 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 GetFloatv is called, a boolean value is interpreted as either 1.0 or 0.0, an integer is coerced to floating-point. If a value is so large in magnitude that it cannot be represented with the requested type, then the nearest value representable using the requested type is returned.

The following symbolic constants are accepted by pname:

GL_ALIASED_POINT_SIZE_RANGE

params returns two values, the smallest and largest supported sizes for aliased points. The range must include 1. See glPointSize.

GL_ALIASED_LINE_WIDTH_RANGE

params returns two values, the smallest and largest supported widths for aliased lines. The range must include 1. See glLineWidth.

GL_ALPHA_BITS

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

GL_ALPHA_TEST_FUNC

params returns one value, the symbolic name of the alpha test function. See glAlphaFunc

GL_ALPHA_TEST_REF

params returns one value, the reference value for the alpha test. 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. See glAlphaFunc

GL_BLEND_DST

params returns one value, the symbolic constant identifying the destination blend function. See glBlendFunc

GL_BLEND_SRC

params returns one value, the symbolic constant identifying the source blend function. See glBlendFunc

GL_BLUE_BITS

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

GL_COLOR_ARRAY_BUFFER_BINDING

params returns one value, the color array buffer binding. See glColorPointer.

GL_COLOR_ARRAY_SIZE

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

GL_COLOR_ARRAY_STRIDE

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

GL_COLOR_ARRAY_TYPE

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

GL_COLOR_CLEAR_VALUE

params returns four values: the red, green, blue, and alpha values used to clear the color buffers. See glClearColor

GL_COLOR_WRITEMASK

params returns four boolean values: the red, green, blue, and alpha write enables for the color buffers. See glColorMask

GL_COMPRESSED_TEXTURE_FORMATS

params returns GL_NUM_COMPRESSED_TEXTURE_FORMATS values, the supported compressed texture formats. See glCompressedTexImage2D and glCompressedTexSubImage2D.

GL_CULL_FACE

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

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. See glClearDepth

GL_DEPTH_FUNC

params returns one value, the symbolic name of the depth comparision function. See glDepthFunc

GL_DEPTH_RANGE

params returns two values: the near and far mapping limits for the depth buffer. See glDepthRange

GL_DEPTH_WRITEMASK

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

GL_FOG_COLOR

params returns four values: the red, green, blue, and alpha components of the fog color. See glFog

GL_FOG_DENSITY

params returns one value, the fog density parameter. See glFog

GL_FOG_END

params returns one value, the end factor for the linear fog equation. See glFog

GL_FOG_HINT

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

GL_FOG_MODE

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

GL_FOG_START

params returns one value, the start factor for the linear fog equation. See glFog

GL_FRONT_FACE

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

GL_GREEN_BITS

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

GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES

params returns one value, the preferred format for pixel read back. See glReadPixels.

GL_IMPLEMENTATION_COLOR_READ_TYPE_OES

params returns one value, the preferred type for pixel read back. See glReadPixels.

GL_LIGHT_MODEL_AMBIENT

params returns four values: the red, green, blue, and alpha components of the ambient intensity of the entire scene. 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. See glLightModel

GL_LINE_SMOOTH_HINT

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

GL_LINE_WIDTH

params returns one value, the line width as specified with glLineWidth.

GL_LOGIC_OP_MODE

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

GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES

params returns one value, the matrix index array buffer binding. See glMatrixIndexPointer.

GL_MATRIX_INDEX_ARRAY_SIZE_OES

params returns one value, the number of matrix indices per vertex. See glMatrixIndexPointer.

GL_MATRIX_INDEX_ARRAY_STRIDE_OES

params returns one value, the byte offset between matrix indices. See glMatrixIndexPointer.

GL_MATRIX_INDEX_ARRAY_TYPE_OES

params returns one value, the data type of each matrix index in the matrix indices array. See glMatrixIndexPointer.

GL_MATRIX_MODE

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

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_ELEMENTS_INDICES

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

GL_MAX_ELEMENTS_VERTICES

params returns one value, the recommended maximum number of vertex array vertices. See glDrawArrays and glDrawElements.

GL_MAX_LIGHTS

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

GL_MAX_MODELVIEW_STACK_DEPTH

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

GL_MAX_PALETTE_MATRICES_OES

params returns the size of the matrix palette. The initial value is 9.

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_SIZE

params returns one value. The value gives a rough estimate of the largest texture that the GL can handle. The value must be at least 64. See glTexImage2D, glCompressedTexImage2D, and glCopyTexImage2D.

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 texture units supported. The value must be at least 1. See glActiveTexture, glClientActiveTexture and glMultiTexCoord.

GL_MAX_VERTEX_UNITS_OES

params returns the number of matrices per vertex. The initial value is 3.

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_MODELVIEW_MATRIX

params returns sixteen values: the modelview matrix on the top of the modelview matrix stack. See glPushMatrix.

GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS

params returns a representation of the floating point Model View matrix elements as as an array of integers, according to the IEEE 754 floating point "single format" bit layout. See glMatrixMode.

GL_MODELVIEW_STACK_DEPTH

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

GL_NORMAL_ARRAY_BUFFER_BINDING

params returns one value, the normal array buffer binding. See glNormalPointer.

GL_NORMAL_ARRAY_STRIDE

params returns one value, the byte offset between consective normals in the normal array. See glNormalPointer.

GL_NORMAL_ARRAY_TYPE

params returns one value, the data type of each normal in the normal array. See glNormalPointer.

GL_NUM_COMPRESSED_TEXTURE_FORMATS

params returns one value, the number of supportex compressed texture formats. The value must be at least 10. See glCompressedTexImage2D and glCompressedTexSubImage2D.

GL_PACK_ALIGNMENT

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

GL_PERSPECTIVE_CORRECTION_HINT

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

GL_POINT_SIZE

params returns one value, the point size as specified by glPointSize.

GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES

params returns one value, the point size array buffer binding. See glPointSizePointer.

GL_POINT_SIZE_ARRAY_STRIDE_OES

params returns one value, the byte offset between consecutive point sizes in the point size array. See glPointSizePointer.

GL_POINT_SIZE_ARRAY_TYPE_OES

params returns one value, the data type of each point size in the point array. See glPointSizePointer.

GL_POINT_SMOOTH_HINT

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

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. 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. See glPolygonOffset.

GL_PROJECTION_MATRIX

params returns sixteen values: the projection matrix on the top of the projection matrix stack. See glPushMatrix.

GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS

params returns a representation of the floating point Projection matrix elements as as an array of integers, according to the IEEE 754 floating point "single format" bit layout. See glMatrixMode.

GL_PROJECTION_STACK_DEPTH

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

GL_RED_BITS

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

GL_SCISSOR_BOX

params returns four values: the x and y window coordinates of the scissor box, followed by its width and height. See glScissor.

GL_SHADE_MODEL

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

GL_SMOOTH_LINE_WIDTH_RANGE

params returns two values, the smallest and largest supported widths for antialiased lines. The range must include 1. See glLineWidth.

GL_SMOOTH_POINT_SIZE_RANGE

params returns two values, the smallest and largest supported widths for antialiased points. The range must include 1. See glPointSize.

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. See glClearStencil

GL_STENCIL_FAIL

params returns one value, a symbolic constant indicating what action is taken when the stencil test fails. See glStencilOp.

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. See glStencilFunc.

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. See glStencilOp.

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. See glStencilOp.

GL_STENCIL_REF

params returns one value, the reference value that is compared with the contents of the stencil buffer. See glStencilFunc.

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. See glStencilFunc.

GL_STENCIL_WRITEMASK

params returns one value, the mask that controls writing of the stencil bitplanes. See glStencilMask.

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 value must be at least 4.

GL_TEXTURE_BINDING_2D

params returns one value, the name of the texture currently bound to the target GL_TEXTURE_2D. See glBindTexture.

GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING

params returns one value, the texture coordinate array buffer binding. See glTexCoordPointer.

GL_TEXTURE_COORD_ARRAY_SIZE

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

GL_TEXTURE_COORD_ARRAY_STRIDE

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

GL_TEXTURE_COORD_ARRAY_TYPE

params returns one value, returns the data type of each coordinate in the texture coordinate array. See glTexCoordPointer.

GL_TEXTURE_MATRIX

params returns sixteen values: the texture matrix on the top of the texture matrix stack. See glPushMatrix.

GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS

params returns a representation of the floating point Texture matrix elements as as an array of integers, according to the IEEE 754 floating point "single format" bit layout. See glMatrixMode.

GL_TEXTURE_STACK_DEPTH

params returns one value, the number of matrices on the texture matrix stack. See glBindTexture.

GL_UNPACK_ALIGNMENT

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

GL_VIEWPORT

params returns four values:, the x and y window coordinates of the viewport, followed by its width and height. See glViewPort.

GL_VERTEX_ARRAY_BUFFER_BINDING

params returns one value, the vertex array buffer binding. See glVertexPointer.

GL_VERTEX_ARRAY_SIZE

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

GL_VERTEX_ARRAY_STRIDE

params returns one value, the byte offset between consecutive vertexes in the vertex array. See glVertexPointer.

GL_VERTEX_ARRAY_TYPE

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

GL_WEIGHT_ARRAY_BUFFER_BINDING_OES

params returns one value, the weight array buffer binding. See glWeightPointer.

GL_WEIGHT_ARRAY_SIZE_OES

params returns one value, the number of weights per vertex. See glWeightPointer.

GL_WEIGHT_ARRAY_STRIDE_OES

params returns one value, the byte offset between weights per vertex. See glWeightPointer.

GL_WEIGHT_ARRAY_TYPE_OES

params returns one value, the data type of each weight in the weight array. See glWeightPointer.

Errors

GL_INVALID_ENUM is generated if pname is not an accepted value.

Copyright

Copyright © 2003-2004 Silicon Graphics, Inc.

This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.

See Also

glGetError, glGetString