glGetTexLevelParameterfv Function

Syntax

GL_APICALL void GL_APIENTRY glGetTexLevelParameterfv(
     GLenum target,
     GLint level,
     GLenum pname,
     GLfloat * params
);

Parameters

Name Description
in target Texture target to get
in level Mipmap level of parameter to get
in pname Parameter to get
out params Pointer to the location where the acquired parameter is stored.

Return Values

No values are returned.

Description

Gets the texture level parameter.

Set target to one the following values. Procedural textures are not supported.

GL_TEXTURE_2D2D texture.
GL_TEXTURE_CUBE_MAP_NEGATIVE_XFace of a cube-map texture in the negative x direction.
GL_TEXTURE_CUBE_MAP_POSITIVE_XFace of a cube-map texture in the positive x direction.
GL_TEXTURE_CUBE_MAP_NEGATIVE_YFace of a cube-map texture in the negative y direction.
GL_TEXTURE_CUBE_MAP_POSITIVE_YFace of a cube-map texture in the positive y direction.
GL_TEXTURE_CUBE_MAP_NEGATIVE_ZFace of a cube-map texture in the negative z direction.
GL_TEXTURE_CUBE_MAP_POSITIVE_ZFace of a cube-map texture in the positive z direction.

The values that can be specified in pname and the paramter that can be retrieved in params are shown in the table below.

GL_TEXTURE_WIDTHWidth of texture (in pixels).
GL_TEXTURE_HEIGHTHeight of texture (in pixels).
GL_TEXTURE_INTERNAL_FORMATInternal format of texture.
GL_TEXTURE_RED_SIZERed component of each pixel (in bits).
GL_TEXTURE_GREEN_SIZEGreen component of each pixel (in bits).
GL_TEXTURE_BLUE_SIZEBlue component of each pixel (in bits).
GL_TEXTURE_ALPHAAlpha component of each pixel (in bits).
GL_TEXTURE_LUMINANCE_SIZELuminance component of each pixel (in bits).
GL_TEXTURE_INTENSITY_SIZEIntensity component of each pixel (in bits). Only valid with GL_SHADOW_DMP format.
GL_TEXTURE_DEPTH_SIZEDepth component of each pixel (in bits). Only valid with GL_SHADOW_DMP format.
GL_TEXTURE_DENSITY1_SIZE_DMPDensity info 1 of each pixel (only valid with GL_GAS_DMP format; density information that does not take into account intersection with gas texture density information).
GL_TEXTURE_DENSITY2_SIZE_DMPDensity info 2 of each pixel (only valid with GL_GAS_DMP format; density information that takes into account intersection with gas texture density information).
GL_TEXTURE_COMPRESSEDTRUE if the texture is a compressed format; FALSE if not compressed.
GL_TEXTURE_COMPRESSED_IMAGE_SIZEIf the texture is a compressed format, the byte size of the mipmap level specified by level.

The internal-format values obtained by GL_TEXTURE_INTERNAL_FORMAT and the corresponding bit counts of the component pixels are as follows.

Internal FormatsRed (255/0/0)Green (0/255/0)Blue (0/0/255)AlphaBrightnessIntensityDepthDensity 1Density 2
GL_RGBA44444
GL_RGB5_A15551
GL_RGBA8888
GL_RGB565565
GL_RGB888
GL_ALPHA8
GL_ALPHA4_EXT4
GL_LUMINANCE8
GL_LUMINANCE4_EXT4
GL_LUMINANCE_ALPHA88
GL_LUMINANCE4_ALPHA4_EXT44
GL_SHADOW_DMP824
GL_GAS_DMP1616
GL_HILO8_DMP88
GL_ETC1_RGB8_NATIVE_DMP888
GL_ETC1_ALPHA_RGB8_A4_NATIVE_DMP8884

This function generates the following errors.

GL_INVALID_OPERATIONIf TEXTURE_COMPRESSED_IMAGE_SIZE is specified for an uncompressed texture.
GL_INVALID_ENUMThe target or pname argument was set to an invalid value.
GL_INVALID_VALUEIf an unloaded mipmap level is specified in level.

Revision History

2011/03/18
Initial version.

CONFIDENTIAL