C Specification

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_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. 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

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.
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_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_BLEND

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

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_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_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_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_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.
See glDepthMask.

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_FOG

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

GL_FOG_COLOR

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

params returns a single boolean value indicating whether the point
size array is enabled. The initial value is GL_FALSE.
See glPointSizePointerOES.

GL_POINT_SIZE_ARRAY_STRIDE_OES

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

GL_POINT_SIZE_ARRAY_TYPE_OES

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

GL_POINT_SIZE_MAX

params
returns one value,
the upper bound to which the derived point size is
clamped. The initial value is the maximum of the implementation dependent max
aliased and smooth point sizes. See
glPointParameter.

GL_POINT_SIZE_MIN

params
returns one value,
the lower bound to which the derived point size is
clamped. The initial value is 0. See
glPointParameter.

GL_POINT_SMOOTH

params returns a single boolean value indicating whether point
antialiasing 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.
See glHint.

GL_POINT_SPRITE_OES

params returns a single boolean value indicating whether point
sprites are enabled. The initial value is GL_FALSE.
See glTexEnv.

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_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_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_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_RESCALE_NORMAL

params returns a single boolean value indicating whether
rescaling of normals is enabled. The initial value is GL_FALSE.
See glNormal.

GL_SAMPLE_ALPHA_TO_COVERAGE

params returns a single boolean value indicating if the
fragment coverage value should be ANDed with a temporary coverage value based
on the fragment's alpha value. The initial value is GL_FALSE.
See glSampleCoverage.

GL_SAMPLE_ALPHA_TO_ONE

params returns a single boolean value indicating if the
fragment's alpha value should be replaced by the maximum representable alpha value
after coverage determination. The initial value is GL_FALSE.
See glSampleCoverage.

GL_SAMPLE_BUFFERS

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

GL_SAMPLE_COVERAGE

params returns a single boolean value indicating if the
fragment coverage value should be ANDed with a temporary coverage value based
on the current sample coverage value. The initial value is GL_FALSE.
See glSampleCoverage.

GL_SAMPLE_COVERAGE_INVERT

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

GL_SAMPLE_COVERAGE_VALUE

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

GL_SAMPLES

params returns a single integer value
indicating the coverage mask size of the currently bound framebuffer.
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.
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_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_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.
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_2D

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

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

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