GLGETTEXLEVELPARAMETER(3gl)GLGETTEXLEVELPARAMETER(3gl)NAME
glGetTexLevelParameterfv, glGetTexLevelParameteriv - return texture
parameter values for a specific level of detail
C SPECIFICATION
void glGetTexLevelParameterfv( GLenum target,
GLint level,
GLenum pname,
GLfloat *params )
void glGetTexLevelParameteriv( GLenum target,
GLint level,
GLenum pname,
GLint *params )
PARAMETERS
target Specifies the symbolic name of the target texture, either
GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, GL_PROXY_TEXTURE_1D,
GL_PROXY_TEXTURE_2D, GL_PROXY_TEXTURE_CUBE_MAP or
GL_DETAIL_TEXTURE_2D_SGIS.
level Specifies the level-of-detail number of the desired image.
Level 0 is the base image level. Level n is the nth mipmap
reduction image.
pname Specifies the symbolic name of a texture parameter. GL_TEX‐
TURE_WIDTH, GL_TEXTURE_HEIGHT, GL_TEXTURE_INTERNAL_FORMAT,
GL_TEXTURE_BORDER, GL_TEXTURE_RED_SIZE, GL_TEXTURE_GREEN_SIZE,
GL_TEXTURE_BLUE_SIZE, GL_TEXTURE_ALPHA_SIZE, GL_TEXTURE_LUMI‐
NANCE_SIZE, GL_TEXTURE_INTENSITY_SIZE, GL_TEXTURE_COM‐
PRESSED_IMAGE_SIZE, GL_TEXTURE_COMPRESSED, GL_TEX‐
TURE_CONSTANT_DATA_SUNX, GL_TEXTURE_MEMORY_SIZE_SUN are
accepted.
params Returns the requested data.
DESCRIPTION
glGetTexLevelParameter returns in params texture parameter values for a
specific level-of-detail value, specified as level. target defines the
target texture, either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEX‐
TURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEX‐
TURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEX‐
TURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, GL_PROXY_TEX‐
TURE_1D, GL_PROXY_TEXTURE_2D, or GL_PROXY_TEXTURE_CUBE_MAP.
GL_MAX_TEXTURE_SIZE is not really descriptive enough. It has to report
the largest square texture image that can be accommodated with mipmaps
and borders, but a long skinny texture, or a texture without mipmaps
and borders, may easily fit in texture memory. The proxy targets allow
the user to more accurately query whether the GL can accommodate a tex‐
ture of a given configuration. If the texture cannot be accommodated,
the texture state variables, which may be queried with glGetTexLevelPa‐
rameter, are set to 0. If the texture can be accommodated, the texture
state values will be set as they would be set for a non-proxy target.
pname specifies the texture parameter whose value or values will be
returned.
The accepted parameter names are as follows:
GL_TEXTURE_WIDTH
params returns a single value, the width of the texture
image. This value includes the border of the texture image.
The initial value is 0.
GL_TEXTURE_HEIGHT
params returns a single value, the height of the texture
image. This value includes the border of the texture image.
The initial value is 0.
GL_TEXTURE_INTERNAL_FORMAT
params returns a single value, the internal format of the
texture image.
GL_TEXTURE_BORDER
params returns a single value, the width in pixels of the
border of the texture image. The initial value is 0.
GL_TEXTURE_RED_SIZE,
GL_TEXTURE_GREEN_SIZE,
GL_TEXTURE_BLUE_SIZE,
GL_TEXTURE_ALPHA_SIZE,
GL_TEXTURE_LUMINANCE_SIZE,
GL_TEXTURE_INTENSITY_SIZE
The internal storage resolution of an individual component.
The resolution chosen by the GL will be a close match for the
resolution requested by the user with the component argument
of glTexImage1D or glTexImage2D. The initial value is 0.
GL_TEXTURE_COMPRESSED_IMAGE_SIZE
params returns the size (in ubytes) of the compressed texture
image that would be returned by glGetCompressedTexImage.
GL_TEXTURE_COMPRESSED
params returns True if texture image has a compressed inter‐
nal format.
GL_TEXTURE_CONSTANT_DATA_SUNX
params returns a single boolean value. This value returns
GL_TRUE if the texture image stored at this level is a con‐
stant. That is, there is no copy made and that application
specified texture image pointer is used internally.
GL_TEXTURE_MEMORY_SIZE_SUN
params returns a single value, the amount of memory (in terms
of bytes) that the texture image consumes.
NOTES
If an error is generated, no change is made to the contents of params.
GL_TEXTURE_INTERNAL_FORMAT is only available if the GL version is 1.1
or greater. In version 1.0, use GL_TEXTURE_COMPONENTS instead.
GL_PROXY_TEXTURE_1D and GL_PROXY_TEXTURE_2D are only available if the
GL version is 1.1 or greater.
ERRORS
GL_INVALID_ENUM is generated if target or pname is not an accepted
value.
GL_INVALID_VALUE is generated if level is less than 0.
GL_INVALID_VALUE may be generated if level is greater than log2 max,
where max is the returned value of GL_MAX_TEXTURE_SIZE.
GL_INVALID_OPERATION is generated if glGetTexLevelParameter is executed
between the execution of glBegin and the corresponding execution of
glEnd.
SEE ALSO
glGetTexParameter, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubIm‐
age1D, glCopyTexSubImage2D, glTexEnv, glTexGen, glTexImage1D, glTexIm‐
age2D, glTexSubImage1D, glTexSubImage2D, glTexParameter, glPixelStore
15 Mar 97 GLGETTEXLEVELPARAMETER(3gl)