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