update upstream sources
[clinton/guile-figl.git] / upstream-doc / man3 / glTexImage2D.xml
CommitLineData
7faf1d71
AW
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="glTexImage2D">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glTexImage2D</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glTexImage2D</refname>
17 <refpurpose>specify a two-dimensional texture image</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glTexImage2D</function></funcdef>
23 <paramdef>GLenum <parameter>target</parameter></paramdef>
24 <paramdef>GLint <parameter>level</parameter></paramdef>
25 <paramdef>GLint <parameter>internalFormat</parameter></paramdef>
26 <paramdef>GLsizei <parameter>width</parameter></paramdef>
27 <paramdef>GLsizei <parameter>height</parameter></paramdef>
28 <paramdef>GLint <parameter>border</parameter></paramdef>
29 <paramdef>GLenum <parameter>format</parameter></paramdef>
30 <paramdef>GLenum <parameter>type</parameter></paramdef>
31 <paramdef>const GLvoid * <parameter>data</parameter></paramdef>
32 </funcprototype>
33 </funcsynopsis>
34 </refsynopsisdiv>
35 <!-- eqn: ignoring delim $$ -->
36 <para>
37 </para>
38 <refsect1 id="parameters"><title>Parameters</title>
39 <variablelist>
40 <varlistentry>
41 <term><parameter>target</parameter></term>
42 <listitem>
43 <para>
44 Specifies the target texture.
45 Must be <constant>GL_TEXTURE_2D</constant>, <constant>GL_PROXY_TEXTURE_2D</constant>,
46 <constant>GL_TEXTURE_1D_ARRAY</constant>, <constant>GL_PROXY_TEXTURE_1D_ARRAY</constant>,
47 <constant>GL_TEXTURE_RECTANGLE</constant>, <constant>GL_PROXY_TEXTURE_RECTANGLE</constant>,
48 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>,
49 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>,
50 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>,
51 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>,
52 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>,
53 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>, or
54 <constant>GL_PROXY_TEXTURE_CUBE_MAP</constant>.
55 </para>
56 </listitem>
57 </varlistentry>
58 <varlistentry>
59 <term><parameter>level</parameter></term>
60 <listitem>
61 <para>
62 Specifies the level-of-detail number.
63 Level 0 is the base image level.
64 Level <emphasis>n</emphasis> is the <emphasis>n</emphasis>th mipmap reduction image.
65 If <parameter>target</parameter> is <constant>GL_TEXTURE_RECTANGLE</constant> or
66 <constant>GL_PROXY_TEXTURE_RECTANGLE</constant>, <parameter>level</parameter> must be 0.
67 </para>
68 </listitem>
69 </varlistentry>
70 <varlistentry>
71 <term><parameter>internalFormat</parameter></term>
72 <listitem>
73 <para>
74 Specifies the number of color components in the texture.
75 Must be one of base internal formats given in Table 1,
76 one of the sized internal formats given in Table 2, or one
77 of the compressed internal formats given in Table 3, below.
78 </para>
79 </listitem>
80 </varlistentry>
81 <varlistentry>
82 <term><parameter>width</parameter></term>
83 <listitem>
84 <para>
85 Specifies the width of the texture image.
86 All implementations support texture images that are at least 1024 texels
87 wide.
88 </para>
89 </listitem>
90 </varlistentry>
91 <varlistentry>
92 <term><parameter>height</parameter></term>
93 <listitem>
94 <para>
95 Specifies the height of the texture image, or the number of layers in a texture
96 array, in the case of the <constant>GL_TEXTURE_1D_ARRAY</constant> and
97 <constant>GL_PROXY_TEXTURE_1D_ARRAY</constant> targets.
98 All implementations support 2D texture images that are at least 1024 texels
99 high, and texture arrays that are at least 256 layers deep.
100 </para>
101 </listitem>
102 </varlistentry>
103 <varlistentry>
104 <term><parameter>border</parameter></term>
105 <listitem>
106 <para>
107 This value must be 0.
108 </para>
109 </listitem>
110 </varlistentry>
111 <varlistentry>
112 <term><parameter>format</parameter></term>
113 <listitem>
114 <para>
115 Specifies the format of the pixel data.
116 The following symbolic values are accepted:
117 <constant>GL_RED</constant>,
118 <constant>GL_RG</constant>,
119 <constant>GL_RGB</constant>,
120 <constant>GL_BGR</constant>,
121 <constant>GL_RGBA</constant>, and
122 <constant>GL_BGRA</constant>.
123 </para>
124 </listitem>
125 </varlistentry>
126 <varlistentry>
127 <term><parameter>type</parameter></term>
128 <listitem>
129 <para>
130 Specifies the data type of the pixel data.
131 The following symbolic values are accepted:
132 <constant>GL_UNSIGNED_BYTE</constant>,
133 <constant>GL_BYTE</constant>,
134 <constant>GL_UNSIGNED_SHORT</constant>,
135 <constant>GL_SHORT</constant>,
136 <constant>GL_UNSIGNED_INT</constant>,
137 <constant>GL_INT</constant>,
138 <constant>GL_FLOAT</constant>,
139 <constant>GL_UNSIGNED_BYTE_3_3_2</constant>,
140 <constant>GL_UNSIGNED_BYTE_2_3_3_REV</constant>,
141 <constant>GL_UNSIGNED_SHORT_5_6_5</constant>,
142 <constant>GL_UNSIGNED_SHORT_5_6_5_REV</constant>,
143 <constant>GL_UNSIGNED_SHORT_4_4_4_4</constant>,
144 <constant>GL_UNSIGNED_SHORT_4_4_4_4_REV</constant>,
145 <constant>GL_UNSIGNED_SHORT_5_5_5_1</constant>,
146 <constant>GL_UNSIGNED_SHORT_1_5_5_5_REV</constant>,
147 <constant>GL_UNSIGNED_INT_8_8_8_8</constant>,
148 <constant>GL_UNSIGNED_INT_8_8_8_8_REV</constant>,
149 <constant>GL_UNSIGNED_INT_10_10_10_2</constant>, and
150 <constant>GL_UNSIGNED_INT_2_10_10_10_REV</constant>.
151 </para>
152 </listitem>
153 </varlistentry>
154 <varlistentry>
155 <term><parameter>data</parameter></term>
156 <listitem>
157 <para>
158 Specifies a pointer to the image data in memory.
159 </para>
160 </listitem>
161 </varlistentry>
162 </variablelist>
163 </refsect1>
164 <refsect1 id="description"><title>Description</title>
165 <para>
166 Texturing allows elements of an image array to be read by shaders.
167 </para>
168 <para>
169 To define texture images, call <function>glTexImage2D</function>.
170 The arguments describe the parameters of the texture image,
171 such as height, width, width of the border, level-of-detail number
172 (see <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>),
173 and number of color components provided.
174 The last three arguments describe how the image is represented in memory.
175 </para>
176 <para>
177 If <parameter>target</parameter> is <constant>GL_PROXY_TEXTURE_2D</constant>, <constant>GL_PROXY_TEXTURE_1D_ARRAY</constant>,
178 <constant>GL_PROXY_TEXTURE_CUBE_MAP</constant>, or <constant>GL_PROXY_TEXTURE_RECTANGLE</constant>,
179 no data is read from <parameter>data</parameter>, but
180 all of the texture image state is recalculated, checked for
181 consistency, and checked
182 against the implementation's capabilities. If the implementation cannot
183 handle a texture of the requested texture size, it sets
184 all of the image state to 0,
185 but does not generate an error (see <citerefentry><refentrytitle>glGetError</refentrytitle></citerefentry>). To query for an
186 entire mipmap array, use an image array level greater than or equal to 1.
187 </para>
188 <para>
189 If <parameter>target</parameter> is <constant>GL_TEXTURE_2D</constant>, <constant>GL_TEXTURE_RECTANGLE</constant>
190 or one of the <constant>GL_TEXTURE_CUBE_MAP</constant>
191 targets, data is read from <parameter>data</parameter> as a sequence of signed or unsigned
192 bytes, shorts, or longs, or single-precision floating-point values,
193 depending on <parameter>type</parameter>. These values are grouped into sets of one, two,
194 three, or four values, depending on <parameter>format</parameter>, to form elements.
195 Each data byte is treated as eight 1-bit elements,
196 with bit ordering determined by <constant>GL_UNPACK_LSB_FIRST</constant>
197 (see <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>).
198 </para>
199 <para>
200 If <parameter>target</parameter> is <constant>GL_TEXTURE_1D_ARRAY</constant>, data is interpreted
201 as an array of one-dimensional images.
202 </para>
203 <para>
204 If a non-zero named buffer object is bound to the <constant>GL_PIXEL_UNPACK_BUFFER</constant> target
205 (see <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>) while a texture image is
206 specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
207 </para>
208 <para>
209 The first element corresponds to the lower left corner of the texture image.
210 Subsequent elements progress left-to-right through the remaining texels
211 in the lowest row of the texture image, and then in successively higher
212 rows of the texture image.
213 The final element corresponds to the upper right corner of the texture
214 image.
215 </para>
216 <para>
217 <parameter>format</parameter> determines the composition of each element in <parameter>data</parameter>.
218 It can assume one of these symbolic values:
219 </para>
220 <variablelist>
221 <varlistentry>
222 <term><constant>GL_RED</constant></term>
223 <listitem>
224 <para>
225 Each element is a single red component.
226 The GL converts it to floating point and assembles it into an RGBA element
227 by attaching 0 for green and blue, and 1 for alpha.
c7b31271 228 Each component is clamped to the range [0,1].
7faf1d71
AW
229 </para>
230 </listitem>
231 </varlistentry>
232 <varlistentry>
233 <term><constant>GL_RG</constant></term>
234 <listitem>
235 <para>
236 Each element is a red/green double.
237 The GL converts it to floating point and assembles it into an RGBA element
238 by attaching 0 for blue, and 1 for alpha.
c7b31271 239 Each component is clamped to the range [0,1].
7faf1d71
AW
240 </para>
241 </listitem>
242 </varlistentry>
243 <varlistentry>
244 <term><constant>GL_RGB</constant></term>
245 <listitem>
246 </listitem>
247 </varlistentry>
248 <varlistentry>
249 <term><constant>GL_BGR</constant></term>
250 <listitem>
251 <para>
252 Each element is an RGB triple.
253 The GL converts it to floating point and assembles it into an RGBA element
254 by attaching 1 for alpha.
c7b31271 255 Each component clamped to the range [0,1].
7faf1d71
AW
256 </para>
257 </listitem>
258 </varlistentry>
259 <varlistentry>
260 <term><constant>GL_RGBA</constant></term>
261 <listitem>
262 </listitem>
263 </varlistentry>
264 <varlistentry>
265 <term><constant>GL_BGRA</constant></term>
266 <listitem>
267 <para>
268 Each element contains all four components.
c7b31271 269 Each component is clamped to the range [0,1].
7faf1d71
AW
270 </para>
271 </listitem>
272 </varlistentry>
273 <varlistentry>
274 <term><constant>GL_DEPTH_COMPONENT</constant></term>
275 <listitem>
276 <para>
277 Each element is a single depth value.
c7b31271 278 The GL converts it to floating point,
7faf1d71
AW
279 and clamps to the range [0,1].
280 </para>
281 </listitem>
282 </varlistentry>
283 <varlistentry>
284 <term><constant>GL_DEPTH_STENCIL</constant></term>
285 <listitem>
286 <para>
287 Each element is a pair of depth and stencil values. The depth component of
288 the pair is interpreted as in <constant>GL_DEPTH_COMPONENT</constant>. The stencil
289 component is interpreted based on specified the depth + stencil internal format.
290 </para>
291 </listitem>
292 </varlistentry>
293 </variablelist>
294 <para>
295 If an application wants to store the texture at a certain
296 resolution or in a certain format, it can request the resolution
297 and format with <parameter>internalFormat</parameter>. The GL will choose an internal
298 representation that closely approximates that requested by <parameter>internalFormat</parameter>, but
299 it may not match exactly.
300 (The representations specified by <constant>GL_RED</constant>,
301 <constant>GL_RG</constant>, <constant>GL_RGB</constant>,
302 and <constant>GL_RGBA</constant> must match exactly.)
303 </para>
304 <para>
305 If the <parameter>internalFormat</parameter> parameter is one of the generic compressed formats,
306 <constant>GL_COMPRESSED_RED</constant>, <constant>GL_COMPRESSED_RG</constant>,
307 <constant>GL_COMPRESSED_RGB</constant>, or
308 <constant>GL_COMPRESSED_RGBA</constant>, 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.
309 </para>
310 <para>
311 If the <parameter>internalFormat</parameter> parameter is
312 <constant>GL_SRGB</constant>,
313 <constant>GL_SRGB8</constant>,
314 <constant>GL_SRGB_ALPHA</constant>, or
315 <constant>GL_SRGB8_ALPHA8</constant>, the texture is treated as if the red, green, or blue components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component
316 <inlineequation><mml:math>
317 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
318 <mml:mi mathvariant="italic">s</mml:mi>
319 </mml:msub>
320 </mml:math></inlineequation>
321 to a linear component
322 <inlineequation><mml:math>
323 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
324 <mml:mi mathvariant="italic">l</mml:mi>
325 </mml:msub>
326 </mml:math></inlineequation>
327 is:
328 </para>
329 <para>
330 <inlineequation><mml:math>
331 <mml:mrow>
332 <mml:msub>
333 <mml:mi mathvariant="italic">c</mml:mi>
334 <mml:mi mathvariant="italic">l</mml:mi>
335 </mml:msub>
336 <mml:mo>=</mml:mo>
337 <mml:mrow>
338 <mml:mo>{</mml:mo>
339
340 <mml:mtable columnalign="left">
341 <mml:mtr>
342 <mml:mtd columnalign="left">
343 <mml:mfrac>
344 <mml:msub>
345 <mml:mi mathvariant="italic">c</mml:mi>
346 <mml:mi mathvariant="italic">s</mml:mi>
347 </mml:msub>
348 <mml:mn>12.92</mml:mn>
349 </mml:mfrac>
350 </mml:mtd>
351 <mml:mtd columnalign="left">
352 <mml:mrow>
353 <mml:mspace width="1ex"/>
354 <mml:mo>if</mml:mo>
355 <mml:mspace width="1ex"/>
356 </mml:mrow>
357 <mml:msub>
358 <mml:mi mathvariant="italic">c</mml:mi>
359 <mml:mi mathvariant="italic">s</mml:mi>
360 </mml:msub>
361 <mml:mo>&le;</mml:mo>
362 <mml:mn>0.04045</mml:mn>
363 </mml:mtd>
364 </mml:mtr>
365 <mml:mtr>
366 <mml:mtd columnalign="left">
367 <mml:msup>
368 <mml:mrow>
369 <mml:mo>(</mml:mo>
370 <mml:mfrac>
371 <mml:mrow>
372 <mml:msub>
373 <mml:mi>c</mml:mi>
374 <mml:mi>s</mml:mi>
375 </mml:msub>
376 <mml:mo>+</mml:mo>
377 <mml:mn>0.055</mml:mn>
378 </mml:mrow>
379 <mml:mn>1.055</mml:mn>
380 </mml:mfrac>
381 <mml:mo>)</mml:mo>
382 </mml:mrow>
383 <mml:mn>2.4</mml:mn>
384 </mml:msup>
385 </mml:mtd>
386 <mml:mtd columnalign="left">
387 <mml:mrow>
388 <mml:mspace width="1ex"/>
389 <mml:mo>if</mml:mo>
390 <mml:mspace width="1ex"/>
391 </mml:mrow>
392 <mml:msub>
393 <mml:mi mathvariant="italic">c</mml:mi>
394 <mml:mi mathvariant="italic">s</mml:mi>
395 </mml:msub>
396 <mml:mo>&gt;</mml:mo>
397 <mml:mn>0.04045</mml:mn>
398 </mml:mtd>
399 </mml:mtr>
400 </mml:mtable>
401 </mml:mrow>
402 </mml:mrow>
403 </mml:math>
404 </inlineequation>
405 </para>
406 <para>
407 Assume
408 <inlineequation><mml:math>
409 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
410 <mml:mi mathvariant="italic">s</mml:mi>
411 </mml:msub>
412 </mml:math></inlineequation>
413 is the sRGB component in the range [0,1].
414 </para>
415 <para>
416 Use the <constant>GL_PROXY_TEXTURE_2D</constant>, <constant>GL_PROXY_TEXTURE_1D_ARRAY</constant>,
417 <constant>GL_PROXY_TEXTURE_RECTANGLE</constant>, or <constant>GL_PROXY_TEXTURE_CUBE_MAP</constant> target to try out a resolution and
418 format. The implementation will
419 update and recompute its best match for the requested storage resolution
420 and format. To then query this state, call <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry>.
421 If the texture cannot be accommodated, texture state is set to 0.
422 </para>
423 <para>
424 A one-component texture image uses only the red component of the RGBA
425 color extracted from <parameter>data</parameter>.
426 A two-component image uses the R and G values.
427 A three-component image uses the R, G, and B values.
428 A four-component image uses all of the RGBA components.
429 </para>
430 <para>
431 Image-based shadowing can be enabled by comparing texture r coordinates to
432 depth texture values to generate a boolean result.
433 See <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry> for details on texture comparison.
434 </para>
435 </refsect1>
436 <refsect1 id="notes"><title>Notes</title>
437 <para>
438 The <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry> mode affects texture images.
439 </para>
440 <para>
441 <parameter>data</parameter> may be a null pointer.
442 In this case, texture memory is
443 allocated to accommodate a texture of width <parameter>width</parameter> and height <parameter>height</parameter>.
444 You can then download subtextures to initialize this
445 texture memory.
446 The image is undefined if the user tries to apply
447 an uninitialized portion of the texture image to a primitive.
448 </para>
449 <para>
450 <function>glTexImage2D</function> specifies the two-dimensional texture for the current texture unit,
451 specified with <citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>.
452 </para>
453 </refsect1>
454 <refsect1 id="errors"><title>Errors</title>
455 <para>
456 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not
457 <constant>GL_TEXTURE_2D</constant>,
458 <constant>GL_TEXTURE_1D_ARRAY</constant>,
459 <constant>GL_TEXTURE_RECTANGLE</constant>,
460 <constant>GL_PROXY_TEXTURE_2D</constant>,
461 <constant>GL_PROXY_TEXTURE_1D_ARRAY</constant>,
462 <constant>GL_PROXY_TEXTURE_RECTANGLE</constant>,
463 <constant>GL_PROXY_TEXTURE_CUBE_MAP</constant>,
464 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>,
465 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>,
466 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>,
467 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>,
468 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>, or
469 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>.
470 </para>
471 <para>
472 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is one of the six cube map 2D image targets and the width and height parameters are not equal.
473 </para>
474 <para>
475 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>type</parameter> is not a type constant.
476 </para>
477 <para>
478 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>width</parameter> is less than 0
479 or greater than <constant>GL_MAX_TEXTURE_SIZE</constant>.
480 </para>
481 <para>
482 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>target</parameter> is not <constant>GL_TEXTURE_1D_ARRAY</constant> or
483 <constant>GL_PROXY_TEXTURE_1D_ARRAY</constant> and <parameter>height</parameter> is less than 0 or greater than <constant>GL_MAX_TEXTURE_SIZE</constant>.
484 </para>
485 <para>
486 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>target</parameter> is <constant>GL_TEXTURE_1D_ARRAY</constant> or
487 <constant>GL_PROXY_TEXTURE_1D_ARRAY</constant> and <parameter>height</parameter> is less than 0 or greater than <constant>GL_MAX_ARRAY_TEXTURE_LAYERS</constant>.
488 </para>
489 <para>
490 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>level</parameter> is less than 0.
491 </para>
492 <para>
493 <constant>GL_INVALID_VALUE</constant> may be generated if <parameter>level</parameter> is greater than
494 <inlineequation><mml:math>
495 <!-- eqn: log sub 2 (max): -->
496 <mml:mrow>
497 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
498 <mml:mn>2</mml:mn>
499 </mml:msub>
500 <mml:mo>&af;</mml:mo>
501 <mml:mfenced open="(" close=")">
502 <mml:mi mathvariant="italic">max</mml:mi>
503 </mml:mfenced>
504 </mml:mrow>
505 </mml:math></inlineequation>,
506 where <emphasis>max</emphasis> is the returned value of <constant>GL_MAX_TEXTURE_SIZE</constant>.
507 </para>
508 <para>
509 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>internalFormat</parameter> is not one of the
510 accepted resolution and format symbolic constants.
511 </para>
512 <para>
513 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>width</parameter> or <parameter>height</parameter> is less than 0
514 or greater than <constant>GL_MAX_TEXTURE_SIZE</constant>.
515 </para>
516 <para>
517 <constant>GL_INVALID_VALUE</constant> is generated if non-power-of-two textures are not supported and the <parameter>width</parameter> or <parameter>height</parameter> cannot be represented as
518 <inlineequation><mml:math>
519 <!-- eqn: 2 sup k + 2(border): -->
520 <mml:mrow>
521 <mml:msup><mml:mn>2</mml:mn>
522 <mml:mi mathvariant="italic">k</mml:mi>
523 </mml:msup>
524 <mml:mo>+</mml:mo>
525 <mml:mrow>
526 <mml:mn>2</mml:mn>
527 <mml:mo>&af;</mml:mo>
528 <mml:mfenced open="(" close=")">
529 <mml:mi mathvariant="italic">border</mml:mi>
530 </mml:mfenced>
531 </mml:mrow>
532 </mml:mrow>
533 </mml:math></inlineequation>
534 for some
535 integer value of <emphasis>k</emphasis>.
536 </para>
537 <para>
538 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>border</parameter> is not 0.
539 </para>
540 <para>
541 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>type</parameter> is one of
542 <constant>GL_UNSIGNED_BYTE_3_3_2</constant>,
543 <constant>GL_UNSIGNED_BYTE_2_3_3_REV</constant>,
544 <constant>GL_UNSIGNED_SHORT_5_6_5</constant>,
545 <constant>GL_UNSIGNED_SHORT_5_6_5_REV</constant>, or
546 <constant>GL_UNSIGNED_INT_10F_11F_11F_REV</constant>,
547 and <parameter>format</parameter> is not <constant>GL_RGB</constant>.
548 </para>
549 <para>
550 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>type</parameter> is one of
551 <constant>GL_UNSIGNED_SHORT_4_4_4_4</constant>,
552 <constant>GL_UNSIGNED_SHORT_4_4_4_4_REV</constant>,
553 <constant>GL_UNSIGNED_SHORT_5_5_5_1</constant>,
554 <constant>GL_UNSIGNED_SHORT_1_5_5_5_REV</constant>,
555 <constant>GL_UNSIGNED_INT_8_8_8_8</constant>,
556 <constant>GL_UNSIGNED_INT_8_8_8_8_REV</constant>,
557 <constant>GL_UNSIGNED_INT_10_10_10_2</constant>,
558 <constant>GL_UNSIGNED_INT_2_10_10_10_REV</constant>, or
559 <constant>GL_UNSIGNED_INT_5_9_9_9_REV</constant>,
560 and <parameter>format</parameter> is neither <constant>GL_RGBA</constant> nor <constant>GL_BGRA</constant>.
561 </para>
562 <para>
563 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>target</parameter> is not
564 <constant>GL_TEXTURE_2D</constant>, <constant>GL_PROXY_TEXTURE_2D</constant>,
565 <constant>GL_TEXTURE_RECTANGLE</constant>, or <constant>GL_PROXY_TEXTURE_RECTANGLE</constant>,
566 and <parameter>internalFormat</parameter> is
567 <constant>GL_DEPTH_COMPONENT</constant>, <constant>GL_DEPTH_COMPONENT16</constant>,
568 <constant>GL_DEPTH_COMPONENT24</constant>, or <constant>GL_DEPTH_COMPONENT32F</constant>.
569 </para>
570 <para>
571 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>format</parameter> is
572 <constant>GL_DEPTH_COMPONENT</constant> and <parameter>internalFormat</parameter> is not
573 <constant>GL_DEPTH_COMPONENT</constant>, <constant>GL_DEPTH_COMPONENT16</constant>,
574 <constant>GL_DEPTH_COMPONENT24</constant>, or <constant>GL_DEPTH_COMPONENT32F</constant>.
575 </para>
576 <para>
577 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>internalFormat</parameter> is
578 <constant>GL_DEPTH_COMPONENT</constant>, <constant>GL_DEPTH_COMPONENT16</constant>,
579 <constant>GL_DEPTH_COMPONENT24</constant>, or <constant>GL_DEPTH_COMPONENT32F</constant>, and <parameter>format</parameter> is
580 not <constant>GL_DEPTH_COMPONENT</constant>.
581 </para>
582 <para>
583 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
584 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the buffer object's data store is currently mapped.
585 </para>
586 <para>
587 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
588 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
589 object such that the memory reads required would exceed the data store size.
590 </para>
591 <para>
592 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
593 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and <parameter>data</parameter> is not evenly divisible
594 into the number of bytes needed to store in memory a datum indicated by <parameter>type</parameter>.
595 </para>
596 <para>
597 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>target</parameter> is <constant>GL_TEXTURE_RECTANGLE</constant>
598 or <constant>GL_PROXY_TEXTURE_RECTANGLE</constant> and <parameter>level</parameter> is not 0.
599 </para>
600 </refsect1>
601 <refsect1 id="associatedgets"><title>Associated Gets</title>
602 <para>
603 <citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry>
604 </para>
605 <para>
606 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_UNPACK_BUFFER_BINDING</constant>
607 </para>
608 </refsect1>
609 <refsect1 id="seealso"><title>See Also</title>
610 <para>
611 <citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
612 <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
613 <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
614 <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
615 <citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
616 <citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
617 <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
618 <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
619 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
620 <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
621 <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>,
622 <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>,
623 <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>
624 </para>
625 </refsect1>
626 <refsect1 id="Copyright"><title>Copyright</title>
627 <para>
628 Copyright <trademark class="copyright"></trademark> 1991-2006
629 Silicon Graphics, Inc. This document is licensed under the SGI
630 Free Software B License. For details, see
631 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
632 </para>
633 </refsect1>
634</refentry>