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