rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man3 / xhtml / glTexImage2D.xml
CommitLineData
7faf1d71
AW
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 then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
125 added to the signed bias <code class="constant">GL_c_BIAS</code>,
126 and clamped to the range [0,1].
127 </p></dd><dt><span class="term"><code class="constant">GL_RG</code></span></dt><dd><p>
128 Each element is a red/green double.
129 The GL converts it to floating point and assembles it into an RGBA element
130 by attaching 0 for blue, and 1 for alpha.
131 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
132 added to the signed bias <code class="constant">GL_c_BIAS</code>,
133 and clamped to the range [0,1].
134 </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>
135 Each element is an RGB triple.
136 The GL converts it to floating point and assembles it into an RGBA element
137 by attaching 1 for alpha.
138 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
139 added to the signed bias <code class="constant">GL_c_BIAS</code>,
140 and clamped to the range [0,1].
141 </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>
142 Each element contains all four components.
143 Each component is multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
144 added to the signed bias <code class="constant">GL_c_BIAS</code>,
145 and clamped to the range [0,1].
146 </p></dd><dt><span class="term"><code class="constant">GL_DEPTH_COMPONENT</code></span></dt><dd><p>
147 Each element is a single depth value.
148 The GL converts it to floating point, multiplies by the signed scale factor
149 <code class="constant">GL_DEPTH_SCALE</code>, adds the signed bias <code class="constant">GL_DEPTH_BIAS</code>,
150 and clamps to the range [0,1].
151 </p></dd><dt><span class="term"><code class="constant">GL_DEPTH_STENCIL</code></span></dt><dd><p>
152 Each element is a pair of depth and stencil values. The depth component of
153 the pair is interpreted as in <code class="constant">GL_DEPTH_COMPONENT</code>. The stencil
154 component is interpreted based on specified the depth + stencil internal format.
155 </p></dd></dl></div><p>
156 If an application wants to store the texture at a certain
157 resolution or in a certain format, it can request the resolution
158 and format with <em class="parameter"><code>internalFormat</code></em>. The GL will choose an internal
159 representation that closely approximates that requested by <em class="parameter"><code>internalFormat</code></em>, but
160 it may not match exactly.
161 (The representations specified by <code class="constant">GL_RED</code>,
162 <code class="constant">GL_RG</code>, <code class="constant">GL_RGB</code>,
163 and <code class="constant">GL_RGBA</code> must match exactly.)
164 </p><p>
165 If the <em class="parameter"><code>internalFormat</code></em> parameter is one of the generic compressed formats,
166 <code class="constant">GL_COMPRESSED_RED</code>, <code class="constant">GL_COMPRESSED_RG</code>,
167 <code class="constant">GL_COMPRESSED_RGB</code>, or
168 <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.
169 </p><p>
170 If the <em class="parameter"><code>internalFormat</code></em> parameter is
171 <code class="constant">GL_SRGB</code>,
172 <code class="constant">GL_SRGB8</code>,
173 <code class="constant">GL_SRGB_ALPHA</code>, or
174 <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
175 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
176 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
177 <mml:mi mathvariant="italic">s</mml:mi>
178 </mml:msub>
179 </mml:math>
180 to a linear component
181 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
182 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
183 <mml:mi mathvariant="italic">l</mml:mi>
184 </mml:msub>
185 </mml:math>
186 is:
187 </p><p>
188 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
189 <mml:mrow>
190 <mml:msub>
191 <mml:mi mathvariant="italic">c</mml:mi>
192 <mml:mi mathvariant="italic">l</mml:mi>
193 </mml:msub>
194 <mml:mo>=</mml:mo>
195 <mml:mrow>
196 <mml:mo>{</mml:mo>
197
198 <mml:mtable columnalign="left">
199 <mml:mtr>
200 <mml:mtd columnalign="left">
201 <mml:mfrac>
202 <mml:msub>
203 <mml:mi mathvariant="italic">c</mml:mi>
204 <mml:mi mathvariant="italic">s</mml:mi>
205 </mml:msub>
206 <mml:mn>12.92</mml:mn>
207 </mml:mfrac>
208 </mml:mtd>
209 <mml:mtd columnalign="left">
210 <mml:mrow>
211 <mml:mspace width="1ex"></mml:mspace>
212 <mml:mo>if</mml:mo>
213 <mml:mspace width="1ex"></mml:mspace>
214 </mml:mrow>
215 <mml:msub>
216 <mml:mi mathvariant="italic">c</mml:mi>
217 <mml:mi mathvariant="italic">s</mml:mi>
218 </mml:msub>
219 <mml:mo>≤</mml:mo>
220 <mml:mn>0.04045</mml:mn>
221 </mml:mtd>
222 </mml:mtr>
223 <mml:mtr>
224 <mml:mtd columnalign="left">
225 <mml:msup>
226 <mml:mrow>
227 <mml:mo>(</mml:mo>
228 <mml:mfrac>
229 <mml:mrow>
230 <mml:msub>
231 <mml:mi>c</mml:mi>
232 <mml:mi>s</mml:mi>
233 </mml:msub>
234 <mml:mo>+</mml:mo>
235 <mml:mn>0.055</mml:mn>
236 </mml:mrow>
237 <mml:mn>1.055</mml:mn>
238 </mml:mfrac>
239 <mml:mo>)</mml:mo>
240 </mml:mrow>
241 <mml:mn>2.4</mml:mn>
242 </mml:msup>
243 </mml:mtd>
244 <mml:mtd columnalign="left">
245 <mml:mrow>
246 <mml:mspace width="1ex"></mml:mspace>
247 <mml:mo>if</mml:mo>
248 <mml:mspace width="1ex"></mml:mspace>
249 </mml:mrow>
250 <mml:msub>
251 <mml:mi mathvariant="italic">c</mml:mi>
252 <mml:mi mathvariant="italic">s</mml:mi>
253 </mml:msub>
254 <mml:mo>&gt;</mml:mo>
255 <mml:mn>0.04045</mml:mn>
256 </mml:mtd>
257 </mml:mtr>
258 </mml:mtable>
259 </mml:mrow>
260 </mml:mrow>
261 </mml:math>
262 </p><p>
263 Assume
264 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
265 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
266 <mml:mi mathvariant="italic">s</mml:mi>
267 </mml:msub>
268 </mml:math>
269 is the sRGB component in the range [0,1].
270 </p><p>
271 Use the <code class="constant">GL_PROXY_TEXTURE_2D</code>, <code class="constant">GL_PROXY_TEXTURE_1D_ARRAY</code>,
272 <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
273 format. The implementation will
274 update and recompute its best match for the requested storage resolution
275 and format. To then query this state, call <a href="glGetTexLevelParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexLevelParameter</span></span></a>.
276 If the texture cannot be accommodated, texture state is set to 0.
277 </p><p>
278 A one-component texture image uses only the red component of the RGBA
279 color extracted from <em class="parameter"><code>data</code></em>.
280 A two-component image uses the R and G values.
281 A three-component image uses the R, G, and B values.
282 A four-component image uses all of the RGBA components.
283 </p><p>
284 Image-based shadowing can be enabled by comparing texture r coordinates to
285 depth texture values to generate a boolean result.
286 See <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a> for details on texture comparison.
287 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
288 The <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> mode affects texture images.
289 </p><p>
290 <em class="parameter"><code>data</code></em> may be a null pointer.
291 In this case, texture memory is
292 allocated to accommodate a texture of width <em class="parameter"><code>width</code></em> and height <em class="parameter"><code>height</code></em>.
293 You can then download subtextures to initialize this
294 texture memory.
295 The image is undefined if the user tries to apply
296 an uninitialized portion of the texture image to a primitive.
297 </p><p>
298 <code class="function">glTexImage2D</code> specifies the two-dimensional texture for the current texture unit,
299 specified with <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>.
300 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
301 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not
302 <code class="constant">GL_TEXTURE_2D</code>,
303 <code class="constant">GL_TEXTURE_1D_ARRAY</code>,
304 <code class="constant">GL_TEXTURE_RECTANGLE</code>,
305 <code class="constant">GL_PROXY_TEXTURE_2D</code>,
306 <code class="constant">GL_PROXY_TEXTURE_1D_ARRAY</code>,
307 <code class="constant">GL_PROXY_TEXTURE_RECTANGLE</code>,
308 <code class="constant">GL_PROXY_TEXTURE_CUBE_MAP</code>,
309 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_X</code>,
310 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_X</code>,
311 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Y</code>,
312 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</code>,
313 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Z</code>, or
314 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</code>.
315 </p><p>
316 <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.
317 </p><p>
318 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not a type constant.
319 </p><p>
320 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>width</code></em> is less than 0
321 or greater than <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
322 </p><p>
323 <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
324 <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>.
325 </p><p>
326 <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
327 <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>.
328 </p><p>
329 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0.
330 </p><p>
331 <code class="constant">GL_INVALID_VALUE</code> may be generated if <em class="parameter"><code>level</code></em> is greater than
332 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
333
334 <mml:mrow>
335 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
336 <mml:mn>2</mml:mn>
337 </mml:msub>
338 <mml:mo>⁡</mml:mo>
339 <mml:mfenced open="(" close=")">
340 <mml:mi mathvariant="italic">max</mml:mi>
341 </mml:mfenced>
342 </mml:mrow>
343 </mml:math>,
344 where <span class="emphasis"><em>max</em></span> is the returned value of <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
345 </p><p>
346 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>internalFormat</code></em> is not one of the
347 accepted resolution and format symbolic constants.
348 </p><p>
349 <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
350 or greater than <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
351 </p><p>
352 <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
353 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
354
355 <mml:mrow>
356 <mml:msup><mml:mn>2</mml:mn>
357 <mml:mi mathvariant="italic">k</mml:mi>
358 </mml:msup>
359 <mml:mo>+</mml:mo>
360 <mml:mrow>
361 <mml:mn>2</mml:mn>
362 <mml:mo>⁡</mml:mo>
363 <mml:mfenced open="(" close=")">
364 <mml:mi mathvariant="italic">border</mml:mi>
365 </mml:mfenced>
366 </mml:mrow>
367 </mml:mrow>
368 </mml:math>
369 for some
370 integer value of <span class="emphasis"><em>k</em></span>.
371 </p><p>
372 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>border</code></em> is not 0.
373 </p><p>
374 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
375 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
376 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
377 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>,
378 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>, or
379 <code class="constant">GL_UNSIGNED_INT_10F_11F_11F_REV</code>,
380 and <em class="parameter"><code>format</code></em> is not <code class="constant">GL_RGB</code>.
381 </p><p>
382 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
383 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
384 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
385 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
386 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
387 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
388 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
389 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>,
390 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>, or
391 <code class="constant">GL_UNSIGNED_INT_5_9_9_9_REV</code>,
392 and <em class="parameter"><code>format</code></em> is neither <code class="constant">GL_RGBA</code> nor <code class="constant">GL_BGRA</code>.
393 </p><p>
394 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>target</code></em> is not
395 <code class="constant">GL_TEXTURE_2D</code>, <code class="constant">GL_PROXY_TEXTURE_2D</code>,
396 <code class="constant">GL_TEXTURE_RECTANGLE</code>, or <code class="constant">GL_PROXY_TEXTURE_RECTANGLE</code>,
397 and <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>.
400 </p><p>
401 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>format</code></em> is
402 <code class="constant">GL_DEPTH_COMPONENT</code> and <em class="parameter"><code>internalFormat</code></em> is not
403 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
404 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32F</code>.
405 </p><p>
406 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>internalFormat</code></em> is
407 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
408 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32F</code>, and <em class="parameter"><code>format</code></em> is
409 not <code class="constant">GL_DEPTH_COMPONENT</code>.
410 </p><p>
411 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
412 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped.
413 </p><p>
414 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
415 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer
416 object such that the memory reads required would exceed the data store size.
417 </p><p>
418 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
419 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and <em class="parameter"><code>data</code></em> is not evenly divisible
420 into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>.
421 </p><p>
422 <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>
423 or <code class="constant">GL_PROXY_TEXTURE_RECTANGLE</code> and <em class="parameter"><code>level</code></em> is not 0.
424 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
425 <a href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a>
426 </p><p>
427 <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>
428 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
429 <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>,
430 <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>,
431 <a href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>,
432 <a href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>,
433 <a href="glCopyTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>,
434 <a href="glCopyTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage3D</span></span></a>,
435 <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>,
436 <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>,
437 <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>,
438 <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>,
439 <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>,
440 <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>,
441 <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>
442 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
443 Copyright <span class="trademark"></span>© 1991-2006
444 Silicon Graphics, Inc. This document is licensed under the SGI
445 Free Software B License. For details, see
446 <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
447 </p></div></div></body></html>