Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> | |
3 | <!-- saved from url=(0013)about:internet --> | |
c7b31271 | 4 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glGetTexLevelParameter - OpenGL 3.3 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glGetTexLevelParameter"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGetTexLevelParameter — return texture parameter values for a specific level of detail</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glGetTexLevelParameterfv</b>(</code></td><td>GLenum </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">level</var>, </td></tr><tr><td> </td><td>GLenum </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLfloat * </td><td><var class="pdparam">params</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glGetTexLevelParameteriv</b>(</code></td><td>GLenum </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">level</var>, </td></tr><tr><td> </td><td>GLenum </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLint * </td><td><var class="pdparam">params</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>target</code></em></span></dt><dd><p> |
7faf1d71 AW |
5 | Specifies the symbolic name of the target texture, |
6 | one of | |
7 | <code class="constant">GL_TEXTURE_1D</code>, | |
8 | <code class="constant">GL_TEXTURE_2D</code>, | |
9 | <code class="constant">GL_TEXTURE_3D</code>, | |
10 | <code class="constant">GL_TEXTURE_1D_ARRAY</code>, | |
11 | <code class="constant">GL_TEXTURE_2D_ARRAY</code>, | |
12 | <code class="constant">GL_TEXTURE_RECTANGLE</code>, | |
13 | <code class="constant">GL_TEXTURE_2D_MULTISAMPLE</code>, | |
14 | <code class="constant">GL_TEXTURE_2D_MULTISAMPLE_ARRAY</code>, | |
15 | <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_X</code>, | |
16 | <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_X</code>, | |
17 | <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Y</code>, | |
18 | <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</code>, | |
19 | <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Z</code>, | |
20 | <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</code>, | |
21 | <code class="constant">GL_PROXY_TEXTURE_1D</code>, | |
22 | <code class="constant">GL_PROXY_TEXTURE_2D</code>, | |
23 | <code class="constant">GL_PROXY_TEXTURE_3D</code>, | |
24 | <code class="constant">GL_PROXY_TEXTURE_1D_ARRAY</code>, | |
25 | <code class="constant">GL_PROXY_TEXTURE_2D_ARRAY</code>, | |
26 | <code class="constant">GL_PROXY_TEXTURE_RECTANGLE</code>, | |
27 | <code class="constant">GL_PROXY_TEXTURE_2D_MULTISAMPLE</code>, | |
28 | <code class="constant">GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY</code>, | |
29 | <code class="constant">GL_PROXY_TEXTURE_CUBE_MAP</code>, or | |
30 | <code class="constant">GL_TEXTURE_BUFFER</code>. | |
31 | </p></dd><dt><span class="term"><em class="parameter"><code>level</code></em></span></dt><dd><p> | |
32 | Specifies the level-of-detail number of the desired image. | |
33 | Level 0 is the base image level. | |
34 | Level | |
35 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math> | |
36 | is the | |
37 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>th | |
38 | mipmap reduction image. | |
39 | </p></dd><dt><span class="term"><em class="parameter"><code>pname</code></em></span></dt><dd><p> | |
40 | Specifies the symbolic name of a texture parameter. | |
41 | <code class="constant">GL_TEXTURE_WIDTH</code>, | |
42 | <code class="constant">GL_TEXTURE_HEIGHT</code>, | |
43 | <code class="constant">GL_TEXTURE_DEPTH</code>, | |
44 | <code class="constant">GL_TEXTURE_INTERNAL_FORMAT</code>, | |
7faf1d71 AW |
45 | <code class="constant">GL_TEXTURE_RED_SIZE</code>, |
46 | <code class="constant">GL_TEXTURE_GREEN_SIZE</code>, | |
47 | <code class="constant">GL_TEXTURE_BLUE_SIZE</code>, | |
48 | <code class="constant">GL_TEXTURE_ALPHA_SIZE</code>, | |
49 | <code class="constant">GL_TEXTURE_DEPTH_SIZE</code>, | |
50 | <code class="constant">GL_TEXTURE_COMPRESSED</code>, and | |
51 | <code class="constant">GL_TEXTURE_COMPRESSED_IMAGE_SIZE</code> | |
52 | are accepted. | |
53 | </p></dd><dt><span class="term"><em class="parameter"><code>params</code></em></span></dt><dd><p> | |
54 | Returns the requested data. | |
55 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
56 | <code class="function">glGetTexLevelParameter</code> returns in <em class="parameter"><code>params</code></em> texture parameter values for a specific | |
57 | level-of-detail value, | |
58 | specified as <em class="parameter"><code>level</code></em>. | |
59 | <em class="parameter"><code>target</code></em> defines the target texture, | |
60 | either <code class="constant">GL_TEXTURE_1D</code>, <code class="constant">GL_TEXTURE_2D</code>, <code class="constant">GL_TEXTURE_3D</code>, | |
61 | <code class="constant">GL_PROXY_TEXTURE_1D</code>, | |
62 | <code class="constant">GL_PROXY_TEXTURE_2D</code>, | |
63 | <code class="constant">GL_PROXY_TEXTURE_3D</code>, | |
64 | <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_X</code>, | |
65 | <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_X</code>, | |
66 | <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Y</code>, | |
67 | <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</code>, | |
68 | <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Z</code>, | |
69 | <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</code>, or | |
70 | <code class="constant">GL_PROXY_TEXTURE_CUBE_MAP</code>. | |
71 | </p><p> | |
72 | <code class="constant">GL_MAX_TEXTURE_SIZE</code>, and <code class="constant">GL_MAX_3D_TEXTURE_SIZE</code> are not really | |
73 | descriptive enough. | |
74 | It has to report the largest square texture image that can be | |
c7b31271 DH |
75 | accommodated with mipmaps |
76 | but a long skinny texture, or a texture without mipmaps may | |
7faf1d71 AW |
77 | easily fit in texture memory. |
78 | The proxy targets allow the user to more accurately query | |
79 | whether the GL can accommodate a texture of a given configuration. | |
80 | If the texture cannot be accommodated, the texture state variables, which | |
81 | may be queried with <code class="function">glGetTexLevelParameter</code>, are set to 0. If the texture can be accommodated, | |
82 | the texture state values will be set as they would be set for a | |
83 | non-proxy target. | |
84 | </p><p> | |
85 | <em class="parameter"><code>pname</code></em> specifies the texture parameter whose value or values | |
86 | will be returned. | |
87 | </p><p> | |
88 | The accepted parameter names are as follows: | |
89 | </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_WIDTH</code></span></dt><dd><p> | |
90 | </p><p> | |
91 | <em class="parameter"><code>params</code></em> returns a single value, | |
92 | the width of the texture image. | |
c7b31271 | 93 | The initial value is 0. |
7faf1d71 AW |
94 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_HEIGHT</code></span></dt><dd><p> |
95 | </p><p> | |
96 | <em class="parameter"><code>params</code></em> returns a single value, | |
97 | the height of the texture image. | |
c7b31271 | 98 | The initial value is 0. |
7faf1d71 AW |
99 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_DEPTH</code></span></dt><dd><p> |
100 | </p><p> | |
101 | <em class="parameter"><code>params</code></em> returns a single value, | |
102 | the depth of the texture image. | |
c7b31271 | 103 | The initial value is 0. |
7faf1d71 AW |
104 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_INTERNAL_FORMAT</code></span></dt><dd><p> |
105 | </p><p> | |
106 | <em class="parameter"><code>params</code></em> returns a single value, | |
107 | the internal format of the texture image. | |
108 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_RED_TYPE</code>,</span></dt><dd></dd><dt><span class="term"><code class="constant">GL_TEXTURE_GREEN_TYPE</code>,</span></dt><dd></dd><dt><span class="term"><code class="constant">GL_TEXTURE_BLUE_TYPE</code>,</span></dt><dd></dd><dt><span class="term"><code class="constant">GL_TEXTURE_ALPHA_TYPE</code>,</span></dt><dd></dd><dt><span class="term"><code class="constant">GL_TEXTURE_DEPTH_TYPE</code></span></dt><dd><p> | |
109 | </p><p> | |
110 | The data type used to store the component. | |
111 | The types <code class="constant">GL_NONE</code>, <code class="constant">GL_SIGNED_NORMALIZED</code>, | |
112 | <code class="constant">GL_UNSIGNED_NORMALIZED</code>, <code class="constant">GL_FLOAT</code>, | |
113 | <code class="constant">GL_INT</code>, and <code class="constant">GL_UNSIGNED_INT</code> may be returned | |
114 | to indicate signed normalized fixed-point, unsigned normalized fixed-point, floating-point, integer unnormalized, and | |
115 | unsigned integer unnormalized components, respectively. | |
116 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_RED_SIZE</code>,</span></dt><dd></dd><dt><span class="term"><code class="constant">GL_TEXTURE_GREEN_SIZE</code>,</span></dt><dd></dd><dt><span class="term"><code class="constant">GL_TEXTURE_BLUE_SIZE</code>,</span></dt><dd></dd><dt><span class="term"><code class="constant">GL_TEXTURE_ALPHA_SIZE</code>,</span></dt><dd></dd><dt><span class="term"><code class="constant">GL_TEXTURE_DEPTH_SIZE</code></span></dt><dd><p> | |
117 | </p><p> | |
118 | The internal storage resolution of an individual component. | |
119 | The resolution chosen by the GL will be a close match for the resolution | |
120 | requested by the user with the component argument of <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, | |
121 | <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>, <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>, <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>, and | |
122 | <a href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>. The initial value is 0. | |
123 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_COMPRESSED</code></span></dt><dd><p> | |
124 | </p><p> | |
125 | <em class="parameter"><code>params</code></em> returns a single boolean value indicating if the texture image is | |
126 | stored in a compressed internal format. The initiali value is <code class="constant">GL_FALSE</code>. | |
127 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_COMPRESSED_IMAGE_SIZE</code></span></dt><dd><p> | |
128 | </p><p> | |
129 | <em class="parameter"><code>params</code></em> returns a single integer value, the number of unsigned bytes of the | |
130 | compressed texture image that would be returned from | |
131 | <a href="glGetCompressedTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetCompressedTexImage</span></span></a>. | |
132 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
133 | If an error is generated, | |
134 | no change is made to the contents of <em class="parameter"><code>params</code></em>. | |
135 | </p><p> | |
136 | <code class="function">glGetTexLevelParameter</code> returns the texture level parameters for the active texture unit. | |
137 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
138 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> or <em class="parameter"><code>pname</code></em> is not an | |
139 | accepted value. | |
140 | </p><p> | |
141 | <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0. | |
142 | </p><p> | |
143 | <code class="constant">GL_INVALID_VALUE</code> may be generated if <em class="parameter"><code>level</code></em> is greater | |
144 | than | |
145 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
146 | ||
147 | <mml:msub><mml:mi mathvariant="italic">log</mml:mi> | |
148 | <mml:mn>2</mml:mn> | |
149 | </mml:msub> | |
150 | </mml:math> | |
151 | <span class="emphasis"><em>max</em></span>, | |
152 | where <span class="emphasis"><em>max</em></span> is the returned value of <code class="constant">GL_MAX_TEXTURE_SIZE</code>. | |
153 | </p><p> | |
154 | <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>target</code></em> is <code class="constant">GL_TEXTURE_BUFFER</code> | |
155 | and <em class="parameter"><code>level</code></em> is not zero. | |
156 | </p><p> | |
157 | <code class="constant">GL_INVALID_OPERATION</code> is generated if | |
158 | <code class="constant">GL_TEXTURE_COMPRESSED_IMAGE_SIZE</code> is queried on texture images with an | |
159 | uncompressed internal format or on proxy targets. | |
160 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
161 | <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>, | |
162 | <a href="glGetTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexParameter</span></span></a>, | |
163 | <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>, | |
164 | <a href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>, | |
165 | <a href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>, | |
166 | <a href="glCopyTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>, | |
167 | <a href="glCopyTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage3D</span></span></a>, | |
168 | <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, | |
169 | <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>, | |
170 | <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>, | |
171 | <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>, | |
172 | <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>, | |
173 | <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>, | |
174 | <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a> | |
175 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
176 | Copyright <span class="trademark"></span>© 1991-2006 | |
177 | Silicon Graphics, Inc. Copyright <span class="trademark"></span>© 2010 | |
178 | Khronos Group. This document is licensed under the SGI | |
179 | Free Software B License. For details, see | |
180 | <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
181 | </p></div></div></body></html> |