---
name: "glGetTexLevelParameter"
section: "3x"
platform: "linux"
package: "xlibmesa-gl-dev"
version: "4.3.0.dfsg.1-14sarge7"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/glGetTexLevelParameter"
---

# glGetTexLevelParameter(3x)

return texture parameter values for a specific level of detail

## 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 )
```

delim $$

## PARAMETERS

- *target*

  Specifies the symbolic name of the target texture, either **GL\_TEXTURE\_1D**, **GL\_TEXTURE\_2D**, **GL\_TEXTURE\_3D**, **GL\_PROXY\_TEXTURE\_1D**, **GL\_PROXY\_TEXTURE\_2D**, or **GL\_PROXY\_TEXTURE\_3D**.

- *level*

  Specifies the level-of-detail number of the desired image. Level 0 is the base image level. Level $n$ is the $n$th mipmap reduction image.

- *pname*

  Specifies the symbolic name of a texture parameter. **GL\_TEXTURE\_WIDTH**, **GL\_TEXTURE\_HEIGHT**, **GL\_TEXTURE\_DEPTH**, **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\_LUMINANCE\_SIZE**, and **GL\_TEXTURE\_INTENSITY\_SIZE** 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\_TEXTURE\_3D**, **GL\_PROXY\_TEXTURE\_1D**,  **GL\_PROXY\_TEXTURE\_2D**, or **GL\_PROXY\_TEXTURE\_3D**.

**GL\_MAX\_TEXTURE\_SIZE**, and **GL\_MAX\_3D\_TEXTURE\_SIZE** are 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 texture of a given configuration. If the texture cannot be accommodated, the texture state variables, which may be queried with **glGetTexLevelParameter**, 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\_DEPTH**

  *params* returns a single value, the depth 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  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**, **glTexImage2D**, **glTexImage3D**, **glCopyTexImage1D**, and **glCopyTexImage2D**. The initial value is 0.

## NOTES

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

**GL\_TEXTURE\_INTERNAL\_FORMAT** is available only 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  available only if the GL version is 1.1 or greater.

**GL\_TEXTURE\_3D**, **GL\_PROXY\_TEXTURE\_3D**, and **GL\_TEXTURE\_DEPTH** are available only if the GL version is 1.2 or greater.

When the **GL\_ARB\_multitexture** extension is supported, **glGetTexLevelParameter** returns the texture level parameters for the active texture unit.

## 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 $ log sub 2$ *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

**glActiveTextureARB(3G)**, **glGetTexParameter(3G)**, **glCopyTexImage1D(3G)**, **glCopyTexImage2D(3G)**, **glCopyTexSubImage1D(3G)**, **glCopyTexSubImage2D(3G)**, **glCopyTexSubImage3D(3G)**, **glTexEnv(3G)**, **glTexGen(3G)**, **glTexImage1D(3G)**, **glTexImage2D(3G)**, **glTexImage3D(3G)**, **glTexSubImage1D(3G)**, **glTexSubImage2D(3G)**, **glTexSubImage3D(3G)**, **glTexParameter(3G)**
