glGetTexLevelParameter(3G) OpenGL Reference glGetTexLevelParameter(3G)
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
GLTEXTURE1D, GLTEXTURE2D, GLTEXTURE3D, GLPROXYTEXTURE1D,
GLPROXYTEXTURE2D, GLPROXYTEXTURE1DEXT,
GLPROXYTEXTURE2DEXT, GLPROXYTEXTURE3DEXT, or
GLDETAILTEXTURE2DSGIS.
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.
GLTEXTUREWIDTH, GLTEXTUREHEIGHT, GLTEXTUREDEPTHEXT,
GLTEXTURECOMPONENTS, GLTEXTUREINTERNALFORMAT,
GLTEXTUREBORDER, GLTEXTUREREDSIZE, GLTEXTUREREDSIZEEXT,
GLTEXTUREGREENSIZE, GLTEXTUREGREENSIZEEXT,
GLTEXTUREBLUESIZE, GLTEXTUREBLUESIZEEXT,
GLTEXTUREALPHASIZE, GLTEXTUREALPHASIZEEXT,
GLTEXTURELUMINANCESIZE, GLTEXTURELUMINANCESIZEEXT,
GLTEXTUREINTENSITYSIZE, and GLTEXTUREINTENSITYSIZEEXT 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, one of GLTEXTURE1D, GLTEXTURE2D, GLTEXTURE3D,
GLPROXYTEXTURE1D, GLPROXYTEXTURE2D, GLPROXYTEXTURE1DEXT,
GLPROXYTEXTURE2DEXT, GLPROXYTEXTURE3DEXT, or
GLDETAILTEXTURE2DSGIS.
GLMAXTEXTURESIZE 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
Page 1
glGetTexLevelParameter(3G) OpenGL Reference glGetTexLevelParameter(3G)
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:
GLTEXTUREWIDTH
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.
GLTEXTUREHEIGHT
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.
GLTEXTUREINTERNALFORMAT
params returns a single value, the internal format of the
texture image.
GLTEXTUREDEPTHEXT
params returns a single value, the depth of the texture image.
This value includes the border of the texture image.
GLTEXTURECOMPONENTS
params returns a single value, the level-of-detail's component
as it was specified by the user.
GLTEXTUREBORDER
params returns a single value, the width in pixels of the
border of the texture image. The initial value is 0.
GLTEXTUREREDSIZE,
GLTEXTUREREDSIZEEXT,
GLTEXTUREGREENSIZE,
GLTEXTUREGREENSIZEEXT,
GLTEXTUREBLUESIZE,
GLTEXTUREBLUESIZEEXT,
Page 2
glGetTexLevelParameter(3G) OpenGL Reference glGetTexLevelParameter(3G)
GLTEXTUREALPHASIZE,
GLTEXTUREALPHASIZEEXT,
GLTEXTURELUMINANCESIZE,
GLTEXTURELUMINANCESIZEEXT,
GLTEXTUREINTENSITYSIZE, or
GLTEXTUREINTENSITYSIZEEXT
The internal storage resolution of an individual component.
The resolution chosen by the GL will be a close match for the
format requested by the user with the component argument of
glTexImage1d, glTexImage2d, or glTexImage3DEXT. These values
for pname query the format chosen by the GL, while
GLTEXTUREINTERNALFORMAT and GLTEXTURECOMPONENTS are used
to query the value requested by the user.
NOTES
If an error is generated, no change is made to the contents of params.
GLTEXTUREINTERNALFORMAT is only available if the GL version is 1.1 or
greater. In version 1.0, use GLTEXTURECOMPONENTS instead.
GLPROXYTEXTURE1D and GLPROXYTEXTURE2D are only available if the GL
version is 1.1 or greater.
texture3D will be present if GLPROXYTEXTURE3DEXT and
GLTEXTURE3DEXT are supported.
ERRORS
GLINVALIDENUM is generated if target, pname, or params is not an
accepted value.
GLINVALIDVALUE is generated if level is less than 0.
GLINVALIDVALUE may be generated if level is greater than log max, where
2
max is the returned value of GLMAXTEXTURESIZE.
GLINVALIDOPERATION is generated if glGetTexLevelParameter is executed
between the execution of glBegin and the corresponding execution of
glEnd.
SEE ALSO
glGetTexParameter, glCopyTexImage1D, glCopyTexImage2D,
glCopyTexSubImage1D, glCopyTexSubImage2D, glTexEnv, glTexGen,
glTexImage1D, glTexImage2D, glTexImage3DEXT, glTexParameter,
glTexSubImage1D, glTexSubImage2D, glGetString.
Page 3