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 --> | |
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 4 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> | |
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>, | |
51 | <code class="constant">GL_TEXTURE_COMPRESSED_IMAGE_SIZE</code>, and | |
52 | <code class="constant">GL_TEXTURE_BUFFER_OFFSET</code> | |
53 | are accepted. | |
54 | </p></dd><dt><span class="term"><em class="parameter"><code>params</code></em></span></dt><dd><p> | |
55 | Returns the requested data. | |
56 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
57 | <code class="function">glGetTexLevelParameter</code> returns in <em class="parameter"><code>params</code></em> texture parameter values for a specific | |
58 | level-of-detail value, | |
59 | specified as <em class="parameter"><code>level</code></em>. | |
60 | <em class="parameter"><code>target</code></em> defines the target texture, | |
61 | either <code class="constant">GL_TEXTURE_1D</code>, <code class="constant">GL_TEXTURE_2D</code>, <code class="constant">GL_TEXTURE_3D</code>, | |
62 | <code class="constant">GL_PROXY_TEXTURE_1D</code>, | |
63 | <code class="constant">GL_PROXY_TEXTURE_2D</code>, | |
64 | <code class="constant">GL_PROXY_TEXTURE_3D</code>, | |
65 | <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_X</code>, | |
66 | <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_X</code>, | |
67 | <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Y</code>, | |
68 | <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</code>, | |
69 | <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Z</code>, | |
70 | <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</code>, or | |
71 | <code class="constant">GL_PROXY_TEXTURE_CUBE_MAP</code>. | |
72 | </p><p> | |
73 | <code class="constant">GL_MAX_TEXTURE_SIZE</code>, and <code class="constant">GL_MAX_3D_TEXTURE_SIZE</code> are not really | |
74 | descriptive enough. | |
75 | It has to report the largest square texture image that can be | |
c7b31271 DH |
76 | accommodated with mipmaps |
77 | but a long skinny texture, or a texture without mipmaps may | |
7faf1d71 AW |
78 | easily fit in texture memory. |
79 | The proxy targets allow the user to more accurately query | |
80 | whether the GL can accommodate a texture of a given configuration. | |
81 | If the texture cannot be accommodated, the texture state variables, which | |
82 | may be queried with <code class="function">glGetTexLevelParameter</code>, are set to 0. If the texture can be accommodated, | |
83 | the texture state values will be set as they would be set for a | |
84 | non-proxy target. | |
85 | </p><p> | |
86 | <em class="parameter"><code>pname</code></em> specifies the texture parameter whose value or values | |
87 | will be returned. | |
88 | </p><p> | |
89 | The accepted parameter names are as follows: | |
90 | </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_WIDTH</code></span></dt><dd><p> | |
91 | </p><p> | |
92 | <em class="parameter"><code>params</code></em> returns a single value, | |
93 | the width of the texture image. | |
c7b31271 | 94 | The initial value is 0. |
7faf1d71 AW |
95 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_HEIGHT</code></span></dt><dd><p> |
96 | </p><p> | |
97 | <em class="parameter"><code>params</code></em> returns a single value, | |
98 | the height of the texture image. | |
c7b31271 | 99 | The initial value is 0. |
7faf1d71 AW |
100 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_DEPTH</code></span></dt><dd><p> |
101 | </p><p> | |
102 | <em class="parameter"><code>params</code></em> returns a single value, | |
103 | the depth of the texture image. | |
c7b31271 | 104 | The initial value is 0. |
7faf1d71 AW |
105 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_INTERNAL_FORMAT</code></span></dt><dd><p> |
106 | </p><p> | |
107 | <em class="parameter"><code>params</code></em> returns a single value, | |
108 | the internal format of the texture image. | |
109 | </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> | |
110 | </p><p> | |
111 | The data type used to store the component. | |
112 | The types <code class="constant">GL_NONE</code>, <code class="constant">GL_SIGNED_NORMALIZED</code>, | |
113 | <code class="constant">GL_UNSIGNED_NORMALIZED</code>, <code class="constant">GL_FLOAT</code>, | |
114 | <code class="constant">GL_INT</code>, and <code class="constant">GL_UNSIGNED_INT</code> may be returned | |
115 | to indicate signed normalized fixed-point, unsigned normalized fixed-point, floating-point, integer unnormalized, and | |
116 | unsigned integer unnormalized components, respectively. | |
117 | </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> | |
118 | </p><p> | |
119 | The internal storage resolution of an individual component. | |
120 | The resolution chosen by the GL will be a close match for the resolution | |
121 | requested by the user with the component argument of <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, | |
122 | <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 | |
123 | <a href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>. The initial value is 0. | |
124 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_COMPRESSED</code></span></dt><dd><p> | |
125 | </p><p> | |
126 | <em class="parameter"><code>params</code></em> returns a single boolean value indicating if the texture image is | |
127 | stored in a compressed internal format. The initiali value is <code class="constant">GL_FALSE</code>. | |
128 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_COMPRESSED_IMAGE_SIZE</code></span></dt><dd><p> | |
129 | </p><p> | |
130 | <em class="parameter"><code>params</code></em> returns a single integer value, the number of unsigned bytes of the | |
131 | compressed texture image that would be returned from | |
132 | <a href="glGetCompressedTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetCompressedTexImage</span></span></a>. | |
133 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_BUFFER_OFFSET</code></span></dt><dd><p> | |
134 | </p><p> | |
135 | <em class="parameter"><code>params</code></em> returns a single integer value, the offset into the | |
136 | data store of the buffer bound to a buffer texture. | |
137 | <a href="glTexBufferRange.xml"><span class="citerefentry"><span class="refentrytitle">glTexBufferRange</span></span></a>. | |
138 | </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_BUFFER_SIZE</code></span></dt><dd><p> | |
139 | </p><p> | |
140 | <em class="parameter"><code>params</code></em> returns a single integer value, the size of the range of a | |
141 | data store of the buffer bound to a buffer texture. | |
142 | <a href="glTexBufferRange.xml"><span class="citerefentry"><span class="refentrytitle">glTexBufferRange</span></span></a>. | |
143 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
144 | If an error is generated, | |
145 | no change is made to the contents of <em class="parameter"><code>params</code></em>. | |
146 | </p><p> | |
147 | <code class="function">glGetTexLevelParameter</code> returns the texture level parameters for the active texture unit. | |
148 | </p><p> | |
149 | <code class="constant">GL_TEXTURE_BUFFER_OFFSET</code> and <code class="constant">GL_TEXTURE_BUFFER_SIZE</code> are available only | |
150 | if the GL version is 4.3 or greater. | |
151 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
152 | <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 | |
153 | accepted value. | |
154 | </p><p> | |
155 | <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0. | |
156 | </p><p> | |
157 | <code class="constant">GL_INVALID_VALUE</code> may be generated if <em class="parameter"><code>level</code></em> is greater | |
158 | than | |
159 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
160 | ||
161 | <mml:msub><mml:mi mathvariant="italic">log</mml:mi> | |
162 | <mml:mn>2</mml:mn> | |
163 | </mml:msub> | |
164 | </mml:math> | |
165 | <span class="emphasis"><em>max</em></span>, | |
166 | where <span class="emphasis"><em>max</em></span> is the returned value of <code class="constant">GL_MAX_TEXTURE_SIZE</code>. | |
167 | </p><p> | |
168 | <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> | |
169 | and <em class="parameter"><code>level</code></em> is not zero. | |
170 | </p><p> | |
171 | <code class="constant">GL_INVALID_OPERATION</code> is generated if | |
172 | <code class="constant">GL_TEXTURE_COMPRESSED_IMAGE_SIZE</code> is queried on texture images with an | |
173 | uncompressed internal format or on proxy targets. | |
174 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
175 | <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>, | |
176 | <a href="glGetTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexParameter</span></span></a>, | |
177 | <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>, | |
178 | <a href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>, | |
179 | <a href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>, | |
180 | <a href="glCopyTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>, | |
181 | <a href="glCopyTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage3D</span></span></a>, | |
182 | <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, | |
183 | <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>, | |
184 | <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>, | |
185 | <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>, | |
186 | <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>, | |
187 | <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>, | |
188 | <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a> | |
189 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
190 | Copyright <span class="trademark"></span>© 1991-2006 | |
c7b31271 | 191 | Silicon Graphics, Inc. Copyright <span class="trademark"></span>© 2010-2013 |
7faf1d71 AW |
192 | Khronos Group. This document is licensed under the SGI |
193 | Free Software B License. For details, see | |
194 | <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
195 | </p></div></div></body></html> |