glGetTexLevelParameteriv function

The glGetTexLevelParameterfv and glGetTexLevelParameteriv functions return texture parameter values for a specific level of detail.

Syntax

void WINAPI glGetTexLevelParameteriv(
   GLenum target,
   GLint  level,
   GLenum pname,
   GLint  *params
);

Parameters

target

The symbolic name of the target texture: either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_PROXY_TEXTURE_1D, or GL_PROXY_TEXTURE_2D.

level

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

The symbolic name of a texture parameter. The following parameter names are accepted.

Value Meaning
GL_TEXTURE_WIDTH
The params parameter returns a single value containing the width of the texture image. This value includes the border of the texture image.
GL_TEXTURE_HEIGHT
The params parameter returns a single value containing the height of the texture image. This value includes the border of the texture image.
GL_TEXTURE_INTERNAL_FORMAT
The params parameter returns a single value which describes the texel format of the texture.
GL_TEXTURE_BORDER
The params parameter returns a single value: the width in pixels of the border of the texture image.
GL_TEXTURE_RED_SIZE
The internal storage resolution of the red component of a texel. The resolution chosen by the OpenGL will be a close match for the resolution requested by the user with the component argument of glTexImage1D or glTexImage2D.
GL_TEXTURE_GREEN_SIZE
The internal storage resolution of the green component of a texel. The resolution chosen by the OpenGL will be a close match for the resolution requested by the user with the component argument of glTexImage1D or glTexImage2D.
GL_TEXTURE_BLUE_SIZE
The internal storage resolution of the blue component of a texel. The resolution chosen by the OpenGL will be a close match for the resolution requested by the user with the component argument of glTexImage1D or glTexImage2D.
GL_TEXTURE_ALPHA_SIZE
The internal storage resolution of the alpha component of a texel. The resolution chosen by the OpenGL will be a close match for the resolution requested by the user with the component argument of glTexImage1D or glTexImage2D.
GL_TEXTURE_LUMINANCE_SIZE
The internal storage resolution of the luminance component of a texel. The resolution chosen by the OpenGL will be a close match for the resolution requested by the user with the component argument of glTexImage1D or glTexImage2D.
GL_TEXTURE_INTENSITY_SIZE
The internal storage resolution of the intensity component of a texel. The resolution chosen by the OpenGL will be a close match for the resolution requested by the user with the component argument of glTexImage1D or glTexImage2D.
GL_TEXTURE_COMPONENTS
The params parameter returns a single value: the number of components in the texture image.

params

Returns the requested data.

Return value

This function does not return a value.

Error codes

The following error codes can be retrieved by the glGetError function.

Name Meaning
GL_INVALID_ENUM
target or pname was not an accepted value.
GL_INVALID_VALUE
level is less than zero or greater than log2*(max)*, where max is the returned value of GL_MAX_TEXTURE_SIZE.
GL_INVALID_OPERATION
The function was called between a call to glBegin and the corresponding call to glEnd.

Remarks

The glGetTexLevelParameter function returns in params texture parameter values for a specific level-of-detail value, specified as level. The target parameter defines the target texture, either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_PROXY_TEXTURE_1D, or GL_PROXY_TEXTURE_2D to specify one-dimensional or two-dimensional texturing. The pname parameter specifies the texture parameter whose value or values will be returned.

If an error is generated, no change is made to the contents of params.

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Gl.h
Library
Opengl32.lib
DLL
Opengl32.dll

See also

glBegin

glEnd

glGetTexParameter

glTexImage1D

glTexImage2D

glTexParameter