GLGET(3G) | GLGET(3G) |
glGetBooleanv, glGetDoublev, glGetFloatv, glGetIntegerv - return the value or values of a selected parameter
void glGetBooleanv( GLenum pname,
GLboolean *params )
void glGetDoublev( GLenum pname,
GLdouble *params )
void glGetFloatv( GLenum pname,
GLfloat *params )
void glGetIntegerv( GLenum pname,
GLint *params )
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:
Many of the boolean parameters can also be queried more easily using glIsEnabled.
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_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_COLOR, GL_BLEND_EQUATION, 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 GL_ARB_imaging is returned from glGet when called with the argument GL_EXTENSIONS.
GL_ACTIVE_TEXTURE_ARB, GL_CLIENT_ACTIVE_TEXTURE_ARB, and GL_MAX_TEXTURE_UNITS_ARB are available only if GL_ARB_multitexture is returned from glGet when called with the argument GL_EXTENSIONS.
When the GL_ARB_multitexture extension is supported, 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_SIZE, GL_TEXTURE_COORD_ARRAY_STRIDE, GL_TEXTURE_COORD_ARRAY_TYPE.
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.
glGetClipPlane, glGetColorTable, glGetColorTableParameter, glGetConvolutionFilter, glGetConvolutionParameter, glGetError, glGetHistogram, glGetHistogramParameter, glGetLight, glGetMap, glGetMaterial, glGetMinmax, glGetMinmaxParameter, glGetPixelMap, glGetPointerv, glGetPolygonStipple, glGetSeparableFilter, glGetString, glGetTexEnv, glGetTexGen, glGetTexImage, glGetTexLevelParameter, glGetTexParameter, glIsEnabled