Name
glGetIntegerv - return the value or values of a selected parameterC Specification
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
glGetIntegerv returns 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 integer in which to place the returned data.The following symbolic constants are accepted by
pname:GL_ALIASED_POINT_SIZE_RANGEparamsreturns two values, the smallest and largest supported sizes for aliased points. The range must include 1. SeeglPointSize.GL_ALIASED_LINE_WIDTH_RANGEparamsreturns two values, the smallest and largest supported widths for aliased lines. The range must include 1. SeeglLineWidth.GL_ALPHA_BITSparamsreturns one value, the number of alpha bitplanes in the color buffer.GL_BLUE_BITSparamsreturns one value, the number of blue bitplanes in the color buffer.GL_COMPRESSED_TEXTURE_FORMATSparamsreturnsGL_NUM_COMPRESSED_TEXTURE_FORMATSvalues, the supported compressed texture formats. SeeglCompressedTexImage2DandglCompressedTexSubImage2D.(glGetIntegerv)GL_DEPTH_BITSparamsreturns one value, the number of bitplanes in the depth buffer.GL_GREEN_BITSparamsreturns one value, the number of green bitplanes in the color buffer.GL_IMPLEMENTATION_COLOR_READ_FORMAT_OESparamsreturns one value, the preferred format for pixel read back. SeeglReadPixels.GL_IMPLEMENTATION_COLOR_READ_TYPE_OESparamsreturns one value, the preferred type for pixel read back. SeeglReadPixels.GL_MAX_ELEMENTS_INDICESparamsreturns one value, the recommended maximum number of vertex array indices. SeeglDrawElements.GL_MAX_ELEMENTS_VERTICESparamsreturns one value, the recommended maximum number of vertex array vertices. SeeglDrawArraysandglDrawElements.GL_MAX_LIGHTSparamsreturns one value, the maximum number of lights. The value must be at least 8. SeeglLight.GL_MAX_MODELVIEW_STACK_DEPTHparamsreturns one value, the maximum supported depth of the modelview matrix stack. The value must be at least 16. SeeglPushMatrix.GL_MAX_PROJECTION_STACK_DEPTHparamsreturns one value, the maximum supported depth of the projection matrix stack. The value must be at least 2. SeeglPushMatrix.GL_MAX_TEXTURE_SIZEparamsreturns one value. The value gives a rough estimate of the largest texture that the GL can handle. The value must be at least 64. SeeglTexImage2D,glCompressedTexImage2D, andglCopyTexImage2D.GL_MAX_TEXTURE_STACK_DEPTHparamsreturns one value, the maximum supported depth of the texture matrix stack. The value must be at least 2. SeeglPushMatrix.GL_MAX_TEXTURE_UNITSparamsreturns a single value indicating the number of texture units supported. The value must be at least 1. SeeglActiveTexture,glClientActiveTextureandglMultiTexCoord.GL_MAX_VIEWPORT_DIMSparamsreturns 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. SeeglViewport.GL_NUM_COMPRESSED_TEXTURE_FORMATSparamsreturns one value, the number of supportex compressed texture formats. The value must be at least 10. SeeglCompressedTexImage2DandglCompressedTexSubImage2D.GL_RED_BITSparamsreturns one value, the number of red bitplanes in each color buffer.GL_SMOOTH_LINE_WIDTH_RANGEparamsreturns two values, the smallest and largest supported widths for antialiased lines. The range must include 1. SeeglLineWidth.GL_SMOOTH_POINT_SIZE_RANGEparamsreturns two values, the smallest and largest supported widths for antialiased points. The range must include 1. SeeglPointSize.GL_STENCIL_BITSparamsreturns one value, the number of bitplanes in the stencil buffer.GL_SUBPIXEL_BITSparamsreturns 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.
(glGetIntegerv)
Errors
GL_INVALID_ENUM is generated if pname is not an accepted value.Copyright
Copyright © 2003 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, glGetStringExample of glGetIntegerv
-------------------------------------------------------------------------
GLint viewport[4];
GLdouble mvmatrix[16], projmatrix[16];
GLint realY;
glGetIntegerv(GL_VIEWPORT,viewport);
glGetDoublev(GL_MODELVIEW_MATRIX,mvmatrix);
glGetDoublev(GL_PROJECTION_MATRIX,projmatrix);
realY = viewport[3] - screenY;
GLfloat winZ;
glReadPixels(screenX, realY, 1,1,GL_DEPTH_COMPONENT,GL_FLOAT,&winZ);
return gluUnProject((GLdouble)screenX,(GLdouble)realY, (GLdouble)winZ, mvmatrix,projmatrix,viewport, &wx,&wy,&wz);