1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glGetTexLevelParameter">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glGetTexLevelParameter
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetTexLevelParameter
</refname>
17 <refpurpose>return texture parameter values for a specific level of detail
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glGetTexLevelParameterfv
</function></funcdef>
23 <paramdef>GLenum
<parameter>target
</parameter></paramdef>
24 <paramdef>GLint
<parameter>level
</parameter></paramdef>
25 <paramdef>GLenum
<parameter>pname
</parameter></paramdef>
26 <paramdef>GLfloat *
<parameter>params
</parameter></paramdef>
31 <funcdef>void
<function>glGetTexLevelParameteriv
</function></funcdef>
32 <paramdef>GLenum
<parameter>target
</parameter></paramdef>
33 <paramdef>GLint
<parameter>level
</parameter></paramdef>
34 <paramdef>GLenum
<parameter>pname
</parameter></paramdef>
35 <paramdef>GLint *
<parameter>params
</parameter></paramdef>
39 <!-- eqn: ignoring delim $$ -->
40 <refsect1 id=
"parameters"><title>Parameters
</title>
43 <term><parameter>target
</parameter></term>
46 Specifies the symbolic name of the target texture,
48 <constant>GL_TEXTURE_1D
</constant>,
49 <constant>GL_TEXTURE_2D
</constant>,
50 <constant>GL_TEXTURE_3D
</constant>,
51 <constant>GL_TEXTURE_1D_ARRAY
</constant>,
52 <constant>GL_TEXTURE_2D_ARRAY
</constant>,
53 <constant>GL_TEXTURE_RECTANGLE
</constant>,
54 <constant>GL_TEXTURE_2D_MULTISAMPLE
</constant>,
55 <constant>GL_TEXTURE_2D_MULTISAMPLE_ARRAY
</constant>,
56 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X
</constant>,
57 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X
</constant>,
58 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y
</constant>,
59 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
</constant>,
60 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z
</constant>,
61 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
</constant>,
62 <constant>GL_PROXY_TEXTURE_1D
</constant>,
63 <constant>GL_PROXY_TEXTURE_2D
</constant>,
64 <constant>GL_PROXY_TEXTURE_3D
</constant>,
65 <constant>GL_PROXY_TEXTURE_1D_ARRAY
</constant>,
66 <constant>GL_PROXY_TEXTURE_2D_ARRAY
</constant>,
67 <constant>GL_PROXY_TEXTURE_RECTANGLE
</constant>,
68 <constant>GL_PROXY_TEXTURE_2D_MULTISAMPLE
</constant>,
69 <constant>GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY
</constant>,
70 <constant>GL_PROXY_TEXTURE_CUBE_MAP
</constant>, or
71 <constant>GL_TEXTURE_BUFFER
</constant>.
76 <term><parameter>level
</parameter></term>
79 Specifies the level-of-detail number of the desired image.
80 Level
0 is the base image level.
82 <inlineequation><mml:math><mml:mi mathvariant=
"italic">n
</mml:mi></mml:math></inlineequation>
84 <inlineequation><mml:math><mml:mi mathvariant=
"italic">n
</mml:mi></mml:math></inlineequation>th
85 mipmap reduction image.
90 <term><parameter>pname
</parameter></term>
93 Specifies the symbolic name of a texture parameter.
94 <constant>GL_TEXTURE_WIDTH
</constant>,
95 <constant>GL_TEXTURE_HEIGHT
</constant>,
96 <constant>GL_TEXTURE_DEPTH
</constant>,
97 <constant>GL_TEXTURE_INTERNAL_FORMAT
</constant>,
98 <constant>GL_TEXTURE_RED_SIZE
</constant>,
99 <constant>GL_TEXTURE_GREEN_SIZE
</constant>,
100 <constant>GL_TEXTURE_BLUE_SIZE
</constant>,
101 <constant>GL_TEXTURE_ALPHA_SIZE
</constant>,
102 <constant>GL_TEXTURE_DEPTH_SIZE
</constant>,
103 <constant>GL_TEXTURE_COMPRESSED
</constant>, and
104 <constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE
</constant>
110 <term><parameter>params
</parameter></term>
113 Returns the requested data.
119 <refsect1 id=
"description"><title>Description
</title>
121 <function>glGetTexLevelParameter
</function> returns in
<parameter>params
</parameter> texture parameter values for a specific
122 level-of-detail value,
123 specified as
<parameter>level
</parameter>.
124 <parameter>target
</parameter> defines the target texture,
125 either
<constant>GL_TEXTURE_1D
</constant>,
<constant>GL_TEXTURE_2D
</constant>,
<constant>GL_TEXTURE_3D
</constant>,
126 <constant>GL_PROXY_TEXTURE_1D
</constant>,
127 <constant>GL_PROXY_TEXTURE_2D
</constant>,
128 <constant>GL_PROXY_TEXTURE_3D
</constant>,
129 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X
</constant>,
130 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X
</constant>,
131 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y
</constant>,
132 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
</constant>,
133 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z
</constant>,
134 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
</constant>, or
135 <constant>GL_PROXY_TEXTURE_CUBE_MAP
</constant>.
138 <constant>GL_MAX_TEXTURE_SIZE
</constant>, and
<constant>GL_MAX_3D_TEXTURE_SIZE
</constant> are not really
140 It has to report the largest square texture image that can be
141 accommodated with mipmaps
142 but a long skinny texture, or a texture without mipmaps may
143 easily fit in texture memory.
144 The proxy targets allow the user to more accurately query
145 whether the GL can accommodate a texture of a given configuration.
146 If the texture cannot be accommodated, the texture state variables, which
147 may be queried with
<function>glGetTexLevelParameter
</function>, are set to
0. If the texture can be accommodated,
148 the texture state values will be set as they would be set for a
152 <parameter>pname
</parameter> specifies the texture parameter whose value or values
156 The accepted parameter names are as follows:
160 <term><constant>GL_TEXTURE_WIDTH
</constant></term>
165 <parameter>params
</parameter> returns a single value,
166 the width of the texture image.
167 The initial value is
0.
172 <term><constant>GL_TEXTURE_HEIGHT
</constant></term>
177 <parameter>params
</parameter> returns a single value,
178 the height of the texture image.
179 The initial value is
0.
184 <term><constant>GL_TEXTURE_DEPTH
</constant></term>
189 <parameter>params
</parameter> returns a single value,
190 the depth of the texture image.
191 The initial value is
0.
196 <term><constant>GL_TEXTURE_INTERNAL_FORMAT
</constant></term>
201 <parameter>params
</parameter> returns a single value,
202 the internal format of the texture image.
207 <term><constant>GL_TEXTURE_RED_TYPE
</constant>,
</term>
212 <term><constant>GL_TEXTURE_GREEN_TYPE
</constant>,
</term>
217 <term><constant>GL_TEXTURE_BLUE_TYPE
</constant>,
</term>
222 <term><constant>GL_TEXTURE_ALPHA_TYPE
</constant>,
</term>
227 <term><constant>GL_TEXTURE_DEPTH_TYPE
</constant></term>
232 The data type used to store the component.
233 The types
<constant>GL_NONE
</constant>,
<constant>GL_SIGNED_NORMALIZED
</constant>,
234 <constant>GL_UNSIGNED_NORMALIZED
</constant>,
<constant>GL_FLOAT
</constant>,
235 <constant>GL_INT
</constant>, and
<constant>GL_UNSIGNED_INT
</constant> may be returned
236 to indicate signed normalized fixed-point, unsigned normalized fixed-point, floating-point, integer unnormalized, and
237 unsigned integer unnormalized components, respectively.
242 <term><constant>GL_TEXTURE_RED_SIZE
</constant>,
</term>
247 <term><constant>GL_TEXTURE_GREEN_SIZE
</constant>,
</term>
252 <term><constant>GL_TEXTURE_BLUE_SIZE
</constant>,
</term>
257 <term><constant>GL_TEXTURE_ALPHA_SIZE
</constant>,
</term>
262 <term><constant>GL_TEXTURE_DEPTH_SIZE
</constant></term>
267 The internal storage resolution of an individual component.
268 The resolution chosen by the GL will be a close match for the resolution
269 requested by the user with the component argument of
<citerefentry><refentrytitle>glTexImage1D
</refentrytitle></citerefentry>,
270 <citerefentry><refentrytitle>glTexImage2D
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D
</refentrytitle></citerefentry>, and
271 <citerefentry><refentrytitle>glCopyTexImage2D
</refentrytitle></citerefentry>. The initial value is
0.
276 <term><constant>GL_TEXTURE_COMPRESSED
</constant></term>
281 <parameter>params
</parameter> returns a single boolean value indicating if the texture image is
282 stored in a compressed internal format. The initiali value is
<constant>GL_FALSE
</constant>.
287 <term><constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE
</constant></term>
292 <parameter>params
</parameter> returns a single integer value, the number of unsigned bytes of the
293 compressed texture image that would be returned from
294 <citerefentry><refentrytitle>glGetCompressedTexImage
</refentrytitle></citerefentry>.
300 <refsect1 id=
"notes"><title>Notes
</title>
302 If an error is generated,
303 no change is made to the contents of
<parameter>params
</parameter>.
306 <function>glGetTexLevelParameter
</function> returns the texture level parameters for the active texture unit.
309 <refsect1 id=
"errors"><title>Errors
</title>
311 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>target
</parameter> or
<parameter>pname
</parameter> is not an
315 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>level
</parameter> is less than
0.
318 <constant>GL_INVALID_VALUE
</constant> may be generated if
<parameter>level
</parameter> is greater
320 <inlineequation><mml:math>
321 <!-- eqn: log sub 2: -->
322 <mml:msub><mml:mi mathvariant=
"italic">log
</mml:mi>
325 </mml:math></inlineequation>
326 <emphasis>max
</emphasis>,
327 where
<emphasis>max
</emphasis> is the returned value of
<constant>GL_MAX_TEXTURE_SIZE
</constant>.
330 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>target
</parameter> is
<constant>GL_TEXTURE_BUFFER
</constant>
331 and
<parameter>level
</parameter> is not zero.
334 <constant>GL_INVALID_OPERATION
</constant> is generated if
335 <constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE
</constant> is queried on texture images with an
336 uncompressed internal format or on proxy targets.
339 <refsect1 id=
"seealso"><title>See Also
</title>
341 <citerefentry><refentrytitle>glActiveTexture
</refentrytitle></citerefentry>,
342 <citerefentry><refentrytitle>glGetTexParameter
</refentrytitle></citerefentry>,
343 <citerefentry><refentrytitle>glCopyTexImage1D
</refentrytitle></citerefentry>,
344 <citerefentry><refentrytitle>glCopyTexImage2D
</refentrytitle></citerefentry>,
345 <citerefentry><refentrytitle>glCopyTexSubImage1D
</refentrytitle></citerefentry>,
346 <citerefentry><refentrytitle>glCopyTexSubImage2D
</refentrytitle></citerefentry>,
347 <citerefentry><refentrytitle>glCopyTexSubImage3D
</refentrytitle></citerefentry>,
348 <citerefentry><refentrytitle>glTexImage1D
</refentrytitle></citerefentry>,
349 <citerefentry><refentrytitle>glTexImage2D
</refentrytitle></citerefentry>,
350 <citerefentry><refentrytitle>glTexImage3D
</refentrytitle></citerefentry>,
351 <citerefentry><refentrytitle>glTexSubImage1D
</refentrytitle></citerefentry>,
352 <citerefentry><refentrytitle>glTexSubImage2D
</refentrytitle></citerefentry>,
353 <citerefentry><refentrytitle>glTexSubImage3D
</refentrytitle></citerefentry>,
354 <citerefentry><refentrytitle>glTexParameter
</refentrytitle></citerefentry>
357 <refsect1 id=
"Copyright"><title>Copyright
</title>
359 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
360 Silicon Graphics, Inc. Copyright
<trademark class=
"copyright"></trademark> 2010-
2013
361 Khronos Group. This document is licensed under the SGI
362 Free Software B License. For details, see
363 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.