rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / glTexSubImage3D.xml
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="glTexSubImage3D">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glTexSubImage3D</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glTexSubImage3D</refname>
17 <refpurpose>specify a three-dimensional texture subimage</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glTexSubImage3D</function></funcdef>
23 <paramdef>GLenum <parameter>target</parameter></paramdef>
24 <paramdef>GLint <parameter>level</parameter></paramdef>
25 <paramdef>GLint <parameter>xoffset</parameter></paramdef>
26 <paramdef>GLint <parameter>yoffset</parameter></paramdef>
27 <paramdef>GLint <parameter>zoffset</parameter></paramdef>
28 <paramdef>GLsizei <parameter>width</parameter></paramdef>
29 <paramdef>GLsizei <parameter>height</parameter></paramdef>
30 <paramdef>GLsizei <parameter>depth</parameter></paramdef>
31 <paramdef>GLenum <parameter>format</parameter></paramdef>
32 <paramdef>GLenum <parameter>type</parameter></paramdef>
33 <paramdef>const GLvoid * <parameter>data</parameter></paramdef>
34 </funcprototype>
35 </funcsynopsis>
36 </refsynopsisdiv>
37 <!-- eqn: ignoring delim $$ -->
38 <para>
39 </para>
40 <refsect1 id="parameters"><title>Parameters</title>
41 <variablelist>
42 <varlistentry>
43 <term><parameter>target</parameter></term>
44 <listitem>
45 <para>
46 Specifies the target texture.
47 Must be <constant>GL_TEXTURE_3D</constant>.
48 </para>
49 </listitem>
50 </varlistentry>
51 <varlistentry>
52 <term><parameter>level</parameter></term>
53 <listitem>
54 <para>
55 Specifies the level-of-detail number.
56 Level 0 is the base image level.
57 Level <emphasis>n</emphasis> is the <emphasis>n</emphasis>th mipmap reduction image.
58 </para>
59 </listitem>
60 </varlistentry>
61 <varlistentry>
62 <term><parameter>xoffset</parameter></term>
63 <listitem>
64 <para>
65 Specifies a texel offset in the x direction within the texture array.
66 </para>
67 </listitem>
68 </varlistentry>
69 <varlistentry>
70 <term><parameter>yoffset</parameter></term>
71 <listitem>
72 <para>
73 Specifies a texel offset in the y direction within the texture array.
74 </para>
75 </listitem>
76 </varlistentry>
77 <varlistentry>
78 <term><parameter>zoffset</parameter></term>
79 <listitem>
80 <para>
81 Specifies a texel offset in the z direction within the texture array.
82 </para>
83 </listitem>
84 </varlistentry>
85 <varlistentry>
86 <term><parameter>width</parameter></term>
87 <listitem>
88 <para>
89 Specifies the width of the texture subimage.
90 </para>
91 </listitem>
92 </varlistentry>
93 <varlistentry>
94 <term><parameter>height</parameter></term>
95 <listitem>
96 <para>
97 Specifies the height of the texture subimage.
98 </para>
99 </listitem>
100 </varlistentry>
101 <varlistentry>
102 <term><parameter>depth</parameter></term>
103 <listitem>
104 <para>
105 Specifies the depth of the texture subimage.
106 </para>
107 </listitem>
108 </varlistentry>
109 <varlistentry>
110 <term><parameter>format</parameter></term>
111 <listitem>
112 <para>
113 Specifies the format of the pixel data.
114 The following symbolic values are accepted:
115 <constant>GL_COLOR_INDEX</constant>,
116 <constant>GL_RED</constant>,
117 <constant>GL_GREEN</constant>,
118 <constant>GL_BLUE</constant>,
119 <constant>GL_ALPHA</constant>,
120 <constant>GL_RGB</constant>,
121 <constant>GL_BGR</constant>,
122 <constant>GL_RGBA</constant>,
123 <constant>GL_BGRA</constant>,
124 <constant>GL_LUMINANCE</constant>, and
125 <constant>GL_LUMINANCE_ALPHA</constant>.
126 </para>
127 </listitem>
128 </varlistentry>
129 <varlistentry>
130 <term><parameter>type</parameter></term>
131 <listitem>
132 <para>
133 Specifies the data type of the pixel data.
134 The following symbolic values are accepted:
135 <constant>GL_UNSIGNED_BYTE</constant>,
136 <constant>GL_BYTE</constant>,
137 <constant>GL_BITMAP</constant>,
138 <constant>GL_UNSIGNED_SHORT</constant>,
139 <constant>GL_SHORT</constant>,
140 <constant>GL_UNSIGNED_INT</constant>,
141 <constant>GL_INT</constant>,
142 <constant>GL_FLOAT</constant>,
143 <constant>GL_UNSIGNED_BYTE_3_3_2</constant>,
144 <constant>GL_UNSIGNED_BYTE_2_3_3_REV</constant>,
145 <constant>GL_UNSIGNED_SHORT_5_6_5</constant>,
146 <constant>GL_UNSIGNED_SHORT_5_6_5_REV</constant>,
147 <constant>GL_UNSIGNED_SHORT_4_4_4_4</constant>,
148 <constant>GL_UNSIGNED_SHORT_4_4_4_4_REV</constant>,
149 <constant>GL_UNSIGNED_SHORT_5_5_5_1</constant>,
150 <constant>GL_UNSIGNED_SHORT_1_5_5_5_REV</constant>,
151 <constant>GL_UNSIGNED_INT_8_8_8_8</constant>,
152 <constant>GL_UNSIGNED_INT_8_8_8_8_REV</constant>,
153 <constant>GL_UNSIGNED_INT_10_10_10_2</constant>, and
154 <constant>GL_UNSIGNED_INT_2_10_10_10_REV</constant>.
155 </para>
156 </listitem>
157 </varlistentry>
158 <varlistentry>
159 <term><parameter>data</parameter></term>
160 <listitem>
161 <para>
162 Specifies a pointer to the image data in memory.
163 </para>
164 </listitem>
165 </varlistentry>
166 </variablelist>
167 </refsect1>
168 <refsect1 id="description"><title>Description</title>
169 <para>
170 Texturing maps a portion of a specified texture image
171 onto each graphical primitive for which texturing is enabled.
172 To enable and disable three-dimensional texturing, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>
173 and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_3D</constant>.
174 </para>
175 <para>
176 <function>glTexSubImage3D</function> redefines a contiguous subregion of an existing three-dimensional
177 texture image.
178 The texels referenced by <parameter>data</parameter> replace the portion of the
179 existing texture array with x indices <parameter>xoffset</parameter> and
180 <inlineequation><mml:math>
181 <!-- eqn: xoffset + width - 1:-->
182 <mml:mrow>
183 <mml:mi mathvariant="italic">xoffset</mml:mi>
184 <mml:mo>+</mml:mo>
185 <mml:mi mathvariant="italic">width</mml:mi>
186 <mml:mo>-</mml:mo>
187 <mml:mn>1</mml:mn>
188 </mml:mrow>
189 </mml:math></inlineequation>,
190 inclusive,
191 y indices <parameter>yoffset</parameter> and
192 <inlineequation><mml:math>
193 <!-- eqn: yoffset + height - 1:-->
194 <mml:mrow>
195 <mml:mi mathvariant="italic">yoffset</mml:mi>
196 <mml:mo>+</mml:mo>
197 <mml:mi mathvariant="italic">height</mml:mi>
198 <mml:mo>-</mml:mo>
199 <mml:mn>1</mml:mn>
200 </mml:mrow>
201 </mml:math></inlineequation>,
202 inclusive,
203 and z indices <parameter>zoffset</parameter> and
204 <inlineequation><mml:math>
205 <!-- eqn: zoffset + depth - 1:-->
206 <mml:mrow>
207 <mml:mi mathvariant="italic">zoffset</mml:mi>
208 <mml:mo>+</mml:mo>
209 <mml:mi mathvariant="italic">depth</mml:mi>
210 <mml:mo>-</mml:mo>
211 <mml:mn>1</mml:mn>
212 </mml:mrow>
213 </mml:math></inlineequation>,
214 inclusive.
215 This region may not include any texels outside the range of the
216 texture array as it was originally specified.
217 It is not an error to specify a subtexture with zero width, height, or
218 depth but such a specification has no effect.
219 </para>
220 <para>
221 If a non-zero named buffer object is bound to the <constant>GL_PIXEL_UNPACK_BUFFER</constant> target
222 (see <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>) while a texture image is
223 specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
224 </para>
225 </refsect1>
226 <refsect1 id="notes"><title>Notes</title>
227 <para>
228 <function>glTexSubImage3D</function> is available only if the GL version is 1.2 or greater.
229 </para>
230 <para>
231 Texturing has no effect in color index mode.
232 </para>
233 <para>
234 <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry> modes affect texture images
235 in exactly the way they affect <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>.
236 </para>
237 <para>
238 Formats <constant>GL_BGR</constant>, and <constant>GL_BGRA</constant> and types
239 <constant>GL_UNSIGNED_BYTE_3_3_2</constant>,
240 <constant>GL_UNSIGNED_BYTE_2_3_3_REV</constant>,
241 <constant>GL_UNSIGNED_SHORT_5_6_5</constant>,
242 <constant>GL_UNSIGNED_SHORT_5_6_5_REV</constant>,
243 <constant>GL_UNSIGNED_SHORT_4_4_4_4</constant>,
244 <constant>GL_UNSIGNED_SHORT_4_4_4_4_REV</constant>,
245 <constant>GL_UNSIGNED_SHORT_5_5_5_1</constant>,
246 <constant>GL_UNSIGNED_SHORT_1_5_5_5_REV</constant>,
247 <constant>GL_UNSIGNED_INT_8_8_8_8</constant>,
248 <constant>GL_UNSIGNED_INT_8_8_8_8_REV</constant>,
249 <constant>GL_UNSIGNED_INT_10_10_10_2</constant>, and
250 <constant>GL_UNSIGNED_INT_2_10_10_10_REV</constant> are available only if the GL version
251 is 1.2 or greater.
252 </para>
253 <para>
254 For OpenGL versions 1.3 and greater, or when the <code>ARB_multitexture</code> extension is supported, <function>glTexSubImage3D</function>
255 specifies a three-dimensional subtexture for the current texture unit,
256 specified with <citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>.
257 </para>
258 <para>
259 When the <code>ARB_imaging</code> extension is supported, the RGBA components
260 specified in <parameter>data</parameter> may be processed by the imaging pipeline. See
261 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry> for specific details.
262 </para>
263 </refsect1>
264 <refsect1 id="errors"><title>Errors</title>
265 <para>
266 <constant>GL_INVALID_ENUM</constant> is generated if /<parameter>target</parameter> is not <constant>GL_TEXTURE_3D</constant>.
267 </para>
268 <para>
269 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>format</parameter> is not an accepted
270 format constant.
271 </para>
272 <para>
273 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>type</parameter> is not a type constant.
274 </para>
275 <para>
276 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>type</parameter> is <constant>GL_BITMAP</constant> and
277 <parameter>format</parameter> is not <constant>GL_COLOR_INDEX</constant>.
278 </para>
279 <para>
280 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>level</parameter> is less than 0.
281 </para>
282 <para>
283 <constant>GL_INVALID_VALUE</constant> may be generated if <parameter>level</parameter> is greater
284 than
285 <inlineequation><mml:math>
286 <!-- eqn: log sub 2:-->
287 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
288 <mml:mn>2</mml:mn>
289 </mml:msub>
290 </mml:math></inlineequation>
291 <emphasis>max</emphasis>,
292 where <emphasis>max</emphasis> is the returned value of <constant>GL_MAX_TEXTURE_SIZE</constant>.
293 </para>
294 <para>
295 <constant>GL_INVALID_VALUE</constant> is generated if
296 <inlineequation><mml:math>
297 <!-- eqn: xoffset < -b:-->
298 <mml:mrow>
299 <mml:mi mathvariant="italic">xoffset</mml:mi>
300 <mml:mo>&lt;</mml:mo>
301 <mml:mrow>
302 <mml:mo>-</mml:mo>
303 <mml:mi mathvariant="italic">b</mml:mi>
304 </mml:mrow>
305 </mml:mrow>
306 </mml:math></inlineequation>,
307 <inlineequation><mml:math>
308 <!-- eqn: (xoffset + width) > (w - b):-->
309 <mml:mrow>
310 <mml:mfenced open="(" close=")">
311 <mml:mrow>
312 <mml:mi mathvariant="italic">xoffset</mml:mi>
313 <mml:mo>+</mml:mo>
314 <mml:mi mathvariant="italic">width</mml:mi>
315 </mml:mrow>
316 </mml:mfenced>
317 <mml:mo>&gt;</mml:mo>
318 <mml:mfenced open="(" close=")">
319 <mml:mrow>
320 <mml:mi mathvariant="italic">w</mml:mi>
321 <mml:mo>-</mml:mo>
322 <mml:mi mathvariant="italic">b</mml:mi>
323 </mml:mrow>
324 </mml:mfenced>
325 </mml:mrow>
326 </mml:math></inlineequation>,
327 <inlineequation><mml:math>
328 <!-- eqn: yoffset < -b:-->
329 <mml:mrow>
330 <mml:mi mathvariant="italic">yoffset</mml:mi>
331 <mml:mo>&lt;</mml:mo>
332 <mml:mrow>
333 <mml:mo>-</mml:mo>
334 <mml:mi mathvariant="italic">b</mml:mi>
335 </mml:mrow>
336 </mml:mrow>
337 </mml:math></inlineequation>,
338 or
339 <inlineequation><mml:math>
340 <!-- eqn: (yoffset + height) > (h - b):-->
341 <mml:mrow>
342 <mml:mfenced open="(" close=")">
343 <mml:mrow>
344 <mml:mi mathvariant="italic">yoffset</mml:mi>
345 <mml:mo>+</mml:mo>
346 <mml:mi mathvariant="italic">height</mml:mi>
347 </mml:mrow>
348 </mml:mfenced>
349 <mml:mo>&gt;</mml:mo>
350 <mml:mfenced open="(" close=")">
351 <mml:mrow>
352 <mml:mi mathvariant="italic">h</mml:mi>
353 <mml:mo>-</mml:mo>
354 <mml:mi mathvariant="italic">b</mml:mi>
355 </mml:mrow>
356 </mml:mfenced>
357 </mml:mrow>
358 </mml:math></inlineequation>,
359 or
360 <inlineequation><mml:math>
361 <!-- eqn: zoffset < -b:-->
362 <mml:mrow>
363 <mml:mi mathvariant="italic">zoffset</mml:mi>
364 <mml:mo>&lt;</mml:mo>
365 <mml:mrow>
366 <mml:mo>-</mml:mo>
367 <mml:mi mathvariant="italic">b</mml:mi>
368 </mml:mrow>
369 </mml:mrow>
370 </mml:math></inlineequation>,
371 or
372 <inlineequation><mml:math>
373 <!-- eqn: (zoffset + depth) > (d - b):-->
374 <mml:mrow>
375 <mml:mfenced open="(" close=")">
376 <mml:mrow>
377 <mml:mi mathvariant="italic">zoffset</mml:mi>
378 <mml:mo>+</mml:mo>
379 <mml:mi mathvariant="italic">depth</mml:mi>
380 </mml:mrow>
381 </mml:mfenced>
382 <mml:mo>&gt;</mml:mo>
383 <mml:mfenced open="(" close=")">
384 <mml:mrow>
385 <mml:mi mathvariant="italic">d</mml:mi>
386 <mml:mo>-</mml:mo>
387 <mml:mi mathvariant="italic">b</mml:mi>
388 </mml:mrow>
389 </mml:mfenced>
390 </mml:mrow>
391 </mml:math></inlineequation>,
392 where
393 <inlineequation><mml:math><mml:mi mathvariant="italic">w</mml:mi></mml:math></inlineequation>
394 is the <constant>GL_TEXTURE_WIDTH</constant>,
395 <inlineequation><mml:math><mml:mi mathvariant="italic">h</mml:mi></mml:math></inlineequation>
396 is the <constant>GL_TEXTURE_HEIGHT</constant>,
397 <inlineequation><mml:math><mml:mi mathvariant="italic">d</mml:mi></mml:math></inlineequation>
398 is the <constant>GL_TEXTURE_DEPTH</constant>
399 and
400 <inlineequation><mml:math><mml:mi mathvariant="italic">b</mml:mi></mml:math></inlineequation>
401 is the border width of the texture image being modified.
402 Note that
403 <inlineequation><mml:math><mml:mi mathvariant="italic">w</mml:mi></mml:math></inlineequation>,
404 <inlineequation><mml:math><mml:mi mathvariant="italic">h</mml:mi></mml:math></inlineequation>,
405 and
406 <inlineequation><mml:math><mml:mi mathvariant="italic">d</mml:mi></mml:math></inlineequation>
407 include twice the border width.
408 </para>
409 <para>
410 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>width</parameter>, <parameter>height</parameter>, or <parameter>depth</parameter>
411 is less than 0.
412 </para>
413 <para>
414 <constant>GL_INVALID_OPERATION</constant> is generated if the texture array has not
415 been defined by a previous <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry> operation.
416 </para>
417 <para>
418 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>type</parameter> is one of
419 <constant>GL_UNSIGNED_BYTE_3_3_2</constant>,
420 <constant>GL_UNSIGNED_BYTE_2_3_3_REV</constant>,
421 <constant>GL_UNSIGNED_SHORT_5_6_5</constant>, or
422 <constant>GL_UNSIGNED_SHORT_5_6_5_REV</constant>
423 and <parameter>format</parameter> is not <constant>GL_RGB</constant>.
424 </para>
425 <para>
426 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>type</parameter> is one of
427 <constant>GL_UNSIGNED_SHORT_4_4_4_4</constant>,
428 <constant>GL_UNSIGNED_SHORT_4_4_4_4_REV</constant>,
429 <constant>GL_UNSIGNED_SHORT_5_5_5_1</constant>,
430 <constant>GL_UNSIGNED_SHORT_1_5_5_5_REV</constant>,
431 <constant>GL_UNSIGNED_INT_8_8_8_8</constant>,
432 <constant>GL_UNSIGNED_INT_8_8_8_8_REV</constant>,
433 <constant>GL_UNSIGNED_INT_10_10_10_2</constant>, or
434 <constant>GL_UNSIGNED_INT_2_10_10_10_REV</constant>
435 and <parameter>format</parameter> is neither <constant>GL_RGBA</constant> nor <constant>GL_BGRA</constant>.
436 </para>
437 <para>
438 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
439 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the buffer object's data store is currently mapped.
440 </para>
441 <para>
442 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
443 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
444 object such that the memory reads required would exceed the data store size.
445 </para>
446 <para>
447 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
448 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and <parameter>data</parameter> is not evenly divisible
449 into the number of bytes needed to store in memory a datum indicated by <parameter>type</parameter>.
450 </para>
451 <para>
452 <constant>GL_INVALID_OPERATION</constant> is generated if <function>glTexSubImage3D</function> is executed
453 between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
454 execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
455 </para>
456 </refsect1>
457 <refsect1 id="associatedgets"><title>Associated Gets</title>
458 <para>
459 <citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry>
460 </para>
461 <para>
462 <citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_3D</constant>
463 </para>
464 <para>
465 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_UNPACK_BUFFER_BINDING</constant>
466 </para>
467 </refsect1>
468 <refsect1 id="seealso"><title>See Also</title>
469 <para>
470 <citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
471 <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
472 <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
473 <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
474 <citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
475 <citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
476 <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
477 <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
478 <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
479 <citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
480 <citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
481 <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
482 <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
483 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
484 <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
485 <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>,
486 <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>
487 </para>
488 </refsect1>
489 <refsect1 id="Copyright"><title>Copyright</title>
490 <para>
491 Copyright <trademark class="copyright"></trademark> 1991-2006
492 Silicon Graphics, Inc. This document is licensed under the SGI
493 Free Software B License. For details, see
494 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
495 </para>
496 </refsect1>
497 </refentry>