e097ecd8ac70aa4ad319701fed6528fac363603e
[clinton/guile-figl.git] / upstream-man-pages / man3 / xhtml / glTexImage3D.xml
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>glTexImage3D</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glTexImage3D"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glTexImage3D — specify a three-dimensional texture image</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">glTexImage3D</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>GLint  </td><td><var class="pdparam">internalFormat</var>, </td></tr><tr><td> </td><td>GLsizei  </td><td><var class="pdparam">width</var>, </td></tr><tr><td> </td><td>GLsizei  </td><td><var class="pdparam">height</var>, </td></tr><tr><td> </td><td>GLsizei  </td><td><var class="pdparam">depth</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">border</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">format</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">type</var>, </td></tr><tr><td> </td><td>const GLvoid *  </td><td><var class="pdparam">data</var><code>)</code>;</td></tr></table></div></div><p>
5 </p><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>
6 Specifies the target texture.
7 Must be one of <code class="constant">GL_TEXTURE_3D</code>, <code class="constant">GL_PROXY_TEXTURE_3D</code>,
8 <code class="constant">GL_TEXTURE_2D_ARRAY</code> or <code class="constant">GL_PROXY_TEXTURE_2D_ARRAY</code>.
9 </p></dd><dt><span class="term"><em class="parameter"><code>level</code></em></span></dt><dd><p>
10 Specifies the level-of-detail number.
11 Level 0 is the base image level.
12 Level
13 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>
14 is the
15 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
16
17 <mml:msup><mml:mi mathvariant="italic">n</mml:mi>
18 <mml:mi mathvariant="italic">th</mml:mi>
19 </mml:msup>
20 </mml:math>
21 mipmap reduction image.
22 </p></dd><dt><span class="term"><em class="parameter"><code>internalFormat</code></em></span></dt><dd><p>
23 Specifies the number of color components in the texture.
24 Must be one of the following symbolic constants:
25 <code class="constant">GL_RGBA32F</code>,
26 <code class="constant">GL_RGBA32I</code>,
27 <code class="constant">GL_RGBA32UI</code>,
28 <code class="constant">GL_RGBA16</code>,
29 <code class="constant">GL_RGBA16F</code>,
30 <code class="constant">GL_RGBA16I</code>,
31 <code class="constant">GL_RGBA16UI</code>,
32 <code class="constant">GL_RGBA8</code>,
33 <code class="constant">GL_RGBA8UI</code>,
34 <code class="constant">GL_SRGB8_ALPHA8</code>,
35 <code class="constant">GL_RGB10_A2</code>,
36 <code class="constant">GL_RGBA10_A2UI</code>,
37 <code class="constant">GL_R11_G11_B10F</code>,
38 <code class="constant">GL_RG32F</code>,
39 <code class="constant">GL_RG32I</code>,
40 <code class="constant">GL_RG32UI</code>,
41 <code class="constant">GL_RG16</code>,
42 <code class="constant">GL_RG16F</code>,
43 <code class="constant">GL_RGB16I</code>,
44 <code class="constant">GL_RGB16UI</code>,
45 <code class="constant">GL_RG8</code>,
46 <code class="constant">GL_RG8I</code>,
47 <code class="constant">GL_RG8UI</code>,
48 <code class="constant">GL_R23F</code>,
49 <code class="constant">GL_R32I</code>,
50 <code class="constant">GL_R32UI</code>,
51 <code class="constant">GL_R16F</code>,
52 <code class="constant">GL_R16I</code>,
53 <code class="constant">GL_R16UI</code>,
54 <code class="constant">GL_R8</code>,
55 <code class="constant">GL_R8I</code>,
56 <code class="constant">GL_R8UI</code>,
57 <code class="constant">GL_RGBA16_UNORM</code>,
58 <code class="constant">GL_RGBA8_SNORM</code>,
59 <code class="constant">GL_RGB32F</code>,
60 <code class="constant">GL_RGB32I</code>,
61 <code class="constant">GL_RGB32UI</code>,
62 <code class="constant">GL_RGB16_SNORM</code>,
63 <code class="constant">GL_RGB16F</code>,
64 <code class="constant">GL_RGB16I</code>,
65 <code class="constant">GL_RGB16UI</code>,
66 <code class="constant">GL_RGB16</code>,
67 <code class="constant">GL_RGB8_SNORM</code>,
68 <code class="constant">GL_RGB8</code>,
69 <code class="constant">GL_RGB8I</code>,
70 <code class="constant">GL_RGB8UI</code>,
71 <code class="constant">GL_SRGB8</code>,
72 <code class="constant">GL_RGB9_E5</code>,
73 <code class="constant">GL_RG16_SNORM</code>,
74 <code class="constant">GL_RG8_SNORM</code>,
75 <code class="constant">GL_COMPRESSED_RG_RGTC2</code>,
76 <code class="constant">GL_COMPRESSED_SIGNED_RG_RGTC2</code>,
77 <code class="constant">GL_R16_SNORM</code>,
78 <code class="constant">GL_R8_SNORM</code>,
79 <code class="constant">GL_COMPRESSED_RED_RGTC1</code>,
80 <code class="constant">GL_COMPRESSED_SIGNED_RED_RGTC1</code>,
81 <code class="constant">GL_DEPTH_COMPONENT32F</code>,
82 <code class="constant">GL_DEPTH_COMPONENT24</code>,
83 <code class="constant">GL_DEPTH_COMPONENT16</code>,
84 <code class="constant">GL_DEPTH32F_STENCIL8</code>,
85 <code class="constant">GL_DEPTH24_STENCIL8</code>.
86 </p></dd><dt><span class="term"><em class="parameter"><code>width</code></em></span></dt><dd><p>
87 Specifies the width of the texture image.
88 All implementations support 3D texture images that are at least 16 texels
89 wide.
90 </p></dd><dt><span class="term"><em class="parameter"><code>height</code></em></span></dt><dd><p>
91 Specifies the height of the texture image.
92 All implementations support 3D texture images that are at least 256 texels
93 high.
94 </p></dd><dt><span class="term"><em class="parameter"><code>depth</code></em></span></dt><dd><p>
95 Specifies the depth of the texture image, or the number of layers in a texture array.
96 All implementations support 3D texture images that are at least 256 texels
97 deep, and texture arrays that are at least 256 layers deep.
98 </p></dd><dt><span class="term"><em class="parameter"><code>border</code></em></span></dt><dd><p>
99 This value must be 0.
100 </p></dd><dt><span class="term"><em class="parameter"><code>format</code></em></span></dt><dd><p>
101 Specifies the format of the pixel data.
102 The following symbolic values are accepted:
103 <code class="constant">GL_RED</code>,
104 <code class="constant">GL_RG</code>,
105 <code class="constant">GL_RGB</code>,
106 <code class="constant">GL_BGR</code>,
107 <code class="constant">GL_RGBA</code>, and
108 <code class="constant">GL_BGRA</code>.
109 </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p>
110 Specifies the data type of the pixel data.
111 The following symbolic values are accepted:
112 <code class="constant">GL_UNSIGNED_BYTE</code>,
113 <code class="constant">GL_BYTE</code>,
114 <code class="constant">GL_UNSIGNED_SHORT</code>,
115 <code class="constant">GL_SHORT</code>,
116 <code class="constant">GL_UNSIGNED_INT</code>,
117 <code class="constant">GL_INT</code>,
118 <code class="constant">GL_FLOAT</code>,
119 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
120 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
121 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>,
122 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>,
123 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
124 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
125 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
126 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
127 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
128 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
129 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, and
130 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>.
131 </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p>
132 Specifies a pointer to the image data in memory.
133 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
134 Texturing maps a portion of a specified texture image
135 onto each graphical primitive for which texturing is enabled.
136 To enable and disable three-dimensional texturing, call <a href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>
137 and <a href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a> with argument <code class="constant">GL_TEXTURE_3D</code>.
138 </p><p>
139 To define texture images, call <code class="function">glTexImage3D</code>.
140 The arguments describe the parameters of the texture image,
141 such as height,
142 width, depth,
143 width of the border,
144 level-of-detail number
145 (see <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>),
146 and number of color components provided.
147 The last three arguments describe how the image is represented in memory.
148 </p><p>
149 If <em class="parameter"><code>target</code></em> is <code class="constant">GL_PROXY_TEXTURE_3D</code>, no data is read from <em class="parameter"><code>data</code></em>, but
150 all of the texture image state is recalculated, checked for
151 consistency, and checked
152 against the implementation's capabilities. If the implementation cannot
153 handle a texture of the requested texture size, it sets
154 all of the image state to 0,
155 but does not generate an error (see <a href="glGetError.xml"><span class="citerefentry"><span class="refentrytitle">glGetError</span></span></a>). To query for an
156 entire mipmap array, use an image array level greater than or equal to
157 1.
158 </p><p>
159 If <em class="parameter"><code>target</code></em> is <code class="constant">GL_TEXTURE_3D</code>,
160 data is read from <em class="parameter"><code>data</code></em> as a sequence of signed or unsigned bytes,
161 shorts,
162 or longs,
163 or single-precision floating-point values,
164 depending on <em class="parameter"><code>type</code></em>.
165 These values are grouped into sets of one,
166 two,
167 three,
168 or four values,
169 depending on <em class="parameter"><code>format</code></em>,
170 to form elements.
171 Each data byte is treated as eight 1-bit elements,
172 with bit ordering determined by <code class="constant">GL_UNPACK_LSB_FIRST</code>
173 (see <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>).
174 </p><p>
175 If a non-zero named buffer object is bound to the <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target
176 (see <a href="glBindBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>) while a texture image is
177 specified, <em class="parameter"><code>data</code></em> is treated as a byte offset into the buffer object's data store.
178 </p><p>
179 The first element corresponds to the lower left corner of the texture
180 image.
181 Subsequent elements progress left-to-right through the remaining texels
182 in the lowest row of the texture image, and then in successively higher
183 rows of the texture image.
184 The final element corresponds to the upper right corner of the texture
185 image.
186 </p><p>
187 <em class="parameter"><code>format</code></em> determines the composition of each element in <em class="parameter"><code>data</code></em>.
188 It can assume one of these symbolic values:
189 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_RED</code></span></dt><dd><p>
190 Each element is a single red component.
191 The GL converts it to floating point and assembles it into an RGBA element
192 by attaching 0 for green and blue, and 1 for alpha.
193 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
194 added to the signed bias <code class="constant">GL_c_BIAS</code>,
195 and clamped to the range [0,1].
196 </p></dd><dt><span class="term"><code class="constant">GL_RG</code></span></dt><dd><p>
197 Each element is a red and green pair.
198 The GL converts each to floating point and assembles it into an RGBA element
199 by attaching 0 for blue, and 1 for alpha.
200 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
201 added to the signed bias <code class="constant">GL_c_BIAS</code>,
202 and clamped to the range [0,1].
203 </p></dd><dt><span class="term"><code class="constant">GL_RGB</code></span></dt><dd></dd><dt><span class="term"><code class="constant">GL_BGR</code></span></dt><dd><p>
204 Each element is an RGB triple.
205 The GL converts it to floating point and assembles it into an RGBA element
206 by attaching 1 for alpha.
207 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
208 added to the signed bias <code class="constant">GL_c_BIAS</code>,
209 and clamped to the range [0,1].
210 </p></dd><dt><span class="term"><code class="constant">GL_RGBA</code></span></dt><dd></dd><dt><span class="term"><code class="constant">GL_BGRA</code></span></dt><dd><p>
211 Each element contains all four components.
212 Each component is multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
213 added to the signed bias <code class="constant">GL_c_BIAS</code>,
214 and clamped to the range [0,1].
215 </p></dd></dl></div><p>
216 If an application wants to store the texture at a certain
217 resolution or in a certain format, it can request the resolution
218 and format with <em class="parameter"><code>internalFormat</code></em>. The GL will choose an internal
219 representation that closely approximates that requested by <em class="parameter"><code>internalFormat</code></em>, but
220 it may not match exactly.
221 (The representations specified by <code class="constant">GL_RED</code>, <code class="constant">GL_RG</code>, <code class="constant">GL_RGB</code>,
222 and <code class="constant">GL_RGBA</code> must match exactly.)
223 </p><p>
224 If the <em class="parameter"><code>internalFormat</code></em> parameter is one of the generic compressed formats,
225 <code class="constant">GL_COMPRESSED_RED</code>, <code class="constant">GL_COMPRESSED_RG</code>,
226 <code class="constant">GL_COMPRESSED_RGB</code>, or
227 <code class="constant">GL_COMPRESSED_RGBA</code>, the GL will replace the internal format with the symbolic constant for a specific internal format and compress the texture before storage. If no corresponding internal format is available, or the GL can not compress that image for any reason, the internal format is instead replaced with a corresponding base internal format.
228 </p><p>
229 If the <em class="parameter"><code>internalFormat</code></em> parameter is
230 <code class="constant">GL_SRGB</code>,
231 <code class="constant">GL_SRGB8</code>,
232 <code class="constant">GL_SRGB_ALPHA</code>, or
233 <code class="constant">GL_SRGB8_ALPHA8</code>, the texture is treated as if the red, green, blue, or luminance components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component
234 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
235 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
236 <mml:mi mathvariant="italic">s</mml:mi>
237 </mml:msub>
238 </mml:math>
239 to a linear component
240 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
241 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
242 <mml:mi mathvariant="italic">l</mml:mi>
243 </mml:msub>
244 </mml:math>
245 is:
246 </p><p>
247 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
248 <mml:mrow>
249 <mml:msub>
250 <mml:mi mathvariant="italic">c</mml:mi>
251 <mml:mi mathvariant="italic">l</mml:mi>
252 </mml:msub>
253 <mml:mo>=</mml:mo>
254 <mml:mrow>
255 <mml:mo>{</mml:mo>
256
257 <mml:mtable columnalign="left">
258 <mml:mtr>
259 <mml:mtd columnalign="left">
260 <mml:mfrac>
261 <mml:msub>
262 <mml:mi mathvariant="italic">c</mml:mi>
263 <mml:mi mathvariant="italic">s</mml:mi>
264 </mml:msub>
265 <mml:mn>12.92</mml:mn>
266 </mml:mfrac>
267 </mml:mtd>
268 <mml:mtd columnalign="left">
269 <mml:mrow>
270 <mml:mspace width="1ex"></mml:mspace>
271 <mml:mo>if</mml:mo>
272 <mml:mspace width="1ex"></mml:mspace>
273 </mml:mrow>
274 <mml:msub>
275 <mml:mi mathvariant="italic">c</mml:mi>
276 <mml:mi mathvariant="italic">s</mml:mi>
277 </mml:msub>
278 <mml:mo></mml:mo>
279 <mml:mn>0.04045</mml:mn>
280 </mml:mtd>
281 </mml:mtr>
282 <mml:mtr>
283 <mml:mtd columnalign="left">
284 <mml:msup>
285 <mml:mrow>
286 <mml:mo>(</mml:mo>
287 <mml:mfrac>
288 <mml:mrow>
289 <mml:msub>
290 <mml:mi>c</mml:mi>
291 <mml:mi>s</mml:mi>
292 </mml:msub>
293 <mml:mo>+</mml:mo>
294 <mml:mn>0.055</mml:mn>
295 </mml:mrow>
296 <mml:mn>1.055</mml:mn>
297 </mml:mfrac>
298 <mml:mo>)</mml:mo>
299 </mml:mrow>
300 <mml:mn>2.4</mml:mn>
301 </mml:msup>
302 </mml:mtd>
303 <mml:mtd columnalign="left">
304 <mml:mrow>
305 <mml:mspace width="1ex"></mml:mspace>
306 <mml:mo>if</mml:mo>
307 <mml:mspace width="1ex"></mml:mspace>
308 </mml:mrow>
309 <mml:msub>
310 <mml:mi mathvariant="italic">c</mml:mi>
311 <mml:mi mathvariant="italic">s</mml:mi>
312 </mml:msub>
313 <mml:mo>&gt;</mml:mo>
314 <mml:mn>0.04045</mml:mn>
315 </mml:mtd>
316 </mml:mtr>
317 </mml:mtable>
318 </mml:mrow>
319 </mml:mrow>
320 </mml:math>
321 </p><p>
322 Assume
323 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
324 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
325 <mml:mi mathvariant="italic">s</mml:mi>
326 </mml:msub>
327 </mml:math>
328 is the sRGB component in the range [0,1].
329 </p><p>
330 Use the <code class="constant">GL_PROXY_TEXTURE_3D</code> target to try out a resolution and
331 format. The implementation will
332 update and recompute its best match for the requested storage resolution
333 and format. To then query this state, call <a href="glGetTexLevelParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexLevelParameter</span></span></a>.
334 If the texture cannot be accommodated, texture state is set to 0.
335 </p><p>
336 A one-component texture image uses only the red component of the RGBA
337 color extracted from <em class="parameter"><code>data</code></em>.
338 A two-component image uses the R and A values.
339 A three-component image uses the R, G, and B values.
340 A four-component image uses all of the RGBA components.
341 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
342 The <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> mode affects texture images.
343 </p><p>
344 <em class="parameter"><code>data</code></em> may be a null pointer.
345 In this case texture memory is
346 allocated to accommodate a texture of width <em class="parameter"><code>width</code></em>, height <em class="parameter"><code>height</code></em>,
347 and depth <em class="parameter"><code>depth</code></em>.
348 You can then download subtextures to initialize this
349 texture memory.
350 The image is undefined if the user tries to apply
351 an uninitialized portion of the texture image to a primitive.
352 </p><p>
353 <code class="function">glTexImage3D</code> specifies the three-dimensional texture for the current texture unit,
354 specified with <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>.
355 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
356 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not <code class="constant">GL_TEXTURE_3D</code>
357 or <code class="constant">GL_PROXY_TEXTURE_3D</code>.
358 </p><p>
359 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>format</code></em> is not an accepted
360 format constant. Format constants other than <code class="constant">GL_STENCIL_INDEX</code> and <code class="constant">GL_DEPTH_COMPONENT</code>
361 are accepted.
362 </p><p>
363 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not a type constant.
364 </p><p>
365 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0.
366 </p><p>
367 <code class="constant">GL_INVALID_VALUE</code> may be generated if <em class="parameter"><code>level</code></em> is greater than
368 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
369
370 <mml:mrow>
371 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
372 <mml:mn>2</mml:mn>
373 </mml:msub>
374 <mml:mo></mml:mo>
375 <mml:mfenced open="(" close=")">
376 <mml:mi mathvariant="italic">max</mml:mi>
377 </mml:mfenced>
378 </mml:mrow>
379 </mml:math>,
380 where <span class="emphasis"><em>max</em></span> is the returned value of <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
381 </p><p>
382 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>internalFormat</code></em> is not one of the
383 accepted resolution and format symbolic constants.
384 </p><p>
385 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>width</code></em>, <em class="parameter"><code>height</code></em>, or <em class="parameter"><code>depth</code></em> is less than 0 or greater than <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
386 </p><p>
387 <code class="constant">GL_INVALID_VALUE</code> is generated if non-power-of-two textures are not supported and the <em class="parameter"><code>width</code></em>, <em class="parameter"><code>height</code></em>, or <em class="parameter"><code>depth</code></em> cannot be represented as
388 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
389
390 <mml:mrow>
391 <mml:msup><mml:mn>2</mml:mn>
392 <mml:mi mathvariant="italic">k</mml:mi>
393 </mml:msup>
394 <mml:mo>+</mml:mo>
395 <mml:mrow>
396 <mml:mn>2</mml:mn>
397 <mml:mo></mml:mo>
398 <mml:mfenced open="(" close=")">
399 <mml:mi mathvariant="italic">border</mml:mi>
400 </mml:mfenced>
401 </mml:mrow>
402 </mml:mrow>
403 </mml:math>
404 for some
405 integer value of <span class="emphasis"><em>k</em></span>.
406 </p><p>
407 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>border</code></em> is not 0 or 1.
408 </p><p>
409 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
410 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
411 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
412 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, or
413 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>
414 and <em class="parameter"><code>format</code></em> is not <code class="constant">GL_RGB</code>.
415 </p><p>
416 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
417 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
418 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
419 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
420 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
421 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
422 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
423 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, or
424 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>
425 and <em class="parameter"><code>format</code></em> is neither <code class="constant">GL_RGBA</code> nor <code class="constant">GL_BGRA</code>.
426 </p><p>
427 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>format</code></em> or <em class="parameter"><code>internalFormat</code></em> is
428 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
429 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32</code>.
430 </p><p>
431 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
432 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped.
433 </p><p>
434 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
435 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer
436 object such that the memory reads required would exceed the data store size.
437 </p><p>
438 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
439 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and <em class="parameter"><code>data</code></em> is not evenly divisible
440 into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>.
441 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
442 <a href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a>
443 </p><p>
444 <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PIXEL_UNPACK_BUFFER_BINDING</code>
445 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
446 <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>,
447 <a href="glCompressedTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage1D</span></span></a>,
448 <a href="glCompressedTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage2D</span></span></a>,
449 <a href="glCompressedTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage3D</span></span></a>,
450 <a href="glCompressedTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage1D</span></span></a>,
451 <a href="glCompressedTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage2D</span></span></a>,
452 <a href="glCompressedTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage3D</span></span></a>,
453 <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>,
454 <a href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>,
455 <a href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>,
456 <a href="glCopyTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>,
457 <a href="glCopyTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage3D</span></span></a>,
458 <a href="glGetCompressedTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetCompressedTexImage</span></span></a>,
459 <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>,
460 <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>,
461 <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>,
462 <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>,
463 <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>,
464 <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>,
465 <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>
466 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
467 Copyright <span class="trademark"></span>© 1991-2006
468 Silicon Graphics, Inc. This document is licensed under the SGI
469 Free Software B License. For details, see
470 <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
471 </p></div></div></body></html>