glGetTexLevelParameteriv Function
GL_APICALL void GL_APIENTRY glGetTexLevelParameteriv(
GLenum target,
GLint level,
GLenum pname,
GLint * params
);
| 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. |
Gets the texture level parameter.
Set target to one the following values. Procedural textures are not supported.
| GL_TEXTURE_2D | 2D texture. |
|---|---|
GL_TEXTURE_CUBE_MAP_NEGATIVE_X | Face of a cube-map texture in the negative x direction. |
GL_TEXTURE_CUBE_MAP_POSITIVE_X | Face of a cube-map texture in the positive x direction. |
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y | Face of a cube-map texture in the negative y direction. |
GL_TEXTURE_CUBE_MAP_POSITIVE_Y | Face of a cube-map texture in the positive y direction. |
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z | Face of a cube-map texture in the negative z direction. |
GL_TEXTURE_CUBE_MAP_POSITIVE_Z | Face 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_WIDTH | Width of texture (in pixels). |
|---|---|
GL_TEXTURE_HEIGHT | Height of texture (in pixels). |
GL_TEXTURE_INTERNAL_FORMAT | Internal format of texture. |
GL_TEXTURE_RED_SIZE | Red component of each pixel (in bits). |
GL_TEXTURE_GREEN_SIZE | Green component of each pixel (in bits). |
GL_TEXTURE_BLUE_SIZE | Blue component of each pixel (in bits). |
GL_TEXTURE_ALPHA | Alpha component of each pixel (in bits). |
GL_TEXTURE_LUMINANCE_SIZE | Luminance component of each pixel (in bits). |
GL_TEXTURE_INTENSITY_SIZE | Intensity component of each pixel (in bits). Only valid with GL_SHADOW_DMP format. |
GL_TEXTURE_DEPTH_SIZE | Depth component of each pixel (in bits). Only valid with GL_SHADOW_DMP format. |
GL_TEXTURE_DENSITY1_SIZE_DMP | Density 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_DMP | Density 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_COMPRESSED | TRUE if the texture is a compressed format; FALSE if not compressed. |
GL_TEXTURE_COMPRESSED_IMAGE_SIZE | If 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 Formats | Red (255/0/0) | Green (0/255/0) | Blue (0/0/255) | Alpha | Brightness | Intensity | Depth | Density 1 | Density 2 |
|---|---|---|---|---|---|---|---|---|---|
GL_RGBA4 | 4 | 4 | 4 | 4 | |||||
GL_RGB5_A1 | 5 | 5 | 5 | 1 | |||||
GL_RGBA | 8 | 8 | 8 | 8 | |||||
GL_RGB565 | 5 | 6 | 5 | ||||||
GL_RGB | 8 | 8 | 8 | ||||||
GL_ALPHA | 8 | ||||||||
GL_ALPHA4_EXT | 4 | ||||||||
GL_LUMINANCE | 8 | ||||||||
GL_LUMINANCE4_EXT | 4 | ||||||||
GL_LUMINANCE_ALPHA | 8 | 8 | |||||||
GL_LUMINANCE4_ALPHA4_EXT | 4 | 4 | |||||||
GL_SHADOW_DMP | 8 | 24 | |||||||
GL_GAS_DMP | 16 | 16 | |||||||
GL_HILO8_DMP | 8 | 8 | |||||||
GL_ETC1_RGB8_NATIVE_DMP | 8 | 8 | 8 | ||||||
GL_ETC1_ALPHA_RGB8_A4_NATIVE_DMP | 8 | 8 | 8 | 4 |
This function generates the following errors.
GL_INVALID_OPERATION | If TEXTURE_COMPRESSED_IMAGE_SIZE is specified for an uncompressed texture. |
|---|---|
GL_INVALID_ENUM | The target or pname argument was set to an invalid value. |
GL_INVALID_VALUE | If an unloaded mipmap level is specified in level. |
CONFIDENTIAL