rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / xhtml / glTexImage2D.xml
CommitLineData
7faf1d71
AW
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
2<!-- saved from url=(0013)about:internet -->
3<?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" /><title>glTexImage2D</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></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>
4 </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>
5 Specifies the target texture.
6 Must be <code class="constant">GL_TEXTURE_2D</code>, <code class="constant">GL_PROXY_TEXTURE_2D</code>,
7 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_X</code>,
8 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_X</code>,
9 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Y</code>,
10 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</code>,
11 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Z</code>,
12 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</code>, or
13 <code class="constant">GL_PROXY_TEXTURE_CUBE_MAP</code>.
14 </p></dd><dt><span class="term"><em class="parameter"><code>level</code></em></span></dt><dd><p>
15 Specifies the level-of-detail number.
16 Level 0 is the base image level.
17 Level <span class="emphasis"><em>n</em></span> is the <span class="emphasis"><em>n</em></span>th mipmap reduction image.
18 </p></dd><dt><span class="term"><em class="parameter"><code>internalFormat</code></em></span></dt><dd><p>
19 Specifies the number of color components in the texture.
20 Must be 1, 2, 3, or 4, or one of the following symbolic constants:
21 <code class="constant">GL_ALPHA</code>,
22 <code class="constant">GL_ALPHA4</code>,
23 <code class="constant">GL_ALPHA8</code>,
24 <code class="constant">GL_ALPHA12</code>,
25 <code class="constant">GL_ALPHA16</code>,
26 <code class="constant">GL_COMPRESSED_ALPHA</code>,
27 <code class="constant">GL_COMPRESSED_LUMINANCE</code>,
28 <code class="constant">GL_COMPRESSED_LUMINANCE_ALPHA</code>,
29 <code class="constant">GL_COMPRESSED_INTENSITY</code>,
30 <code class="constant">GL_COMPRESSED_RGB</code>,
31 <code class="constant">GL_COMPRESSED_RGBA</code>,
32 <code class="constant">GL_DEPTH_COMPONENT</code>,
33 <code class="constant">GL_DEPTH_COMPONENT16</code>,
34 <code class="constant">GL_DEPTH_COMPONENT24</code>,
35 <code class="constant">GL_DEPTH_COMPONENT32</code>,
36 <code class="constant">GL_LUMINANCE</code>,
37 <code class="constant">GL_LUMINANCE4</code>,
38 <code class="constant">GL_LUMINANCE8</code>,
39 <code class="constant">GL_LUMINANCE12</code>,
40 <code class="constant">GL_LUMINANCE16</code>,
41 <code class="constant">GL_LUMINANCE_ALPHA</code>,
42 <code class="constant">GL_LUMINANCE4_ALPHA4</code>,
43 <code class="constant">GL_LUMINANCE6_ALPHA2</code>,
44 <code class="constant">GL_LUMINANCE8_ALPHA8</code>,
45 <code class="constant">GL_LUMINANCE12_ALPHA4</code>,
46 <code class="constant">GL_LUMINANCE12_ALPHA12</code>,
47 <code class="constant">GL_LUMINANCE16_ALPHA16</code>,
48 <code class="constant">GL_INTENSITY</code>,
49 <code class="constant">GL_INTENSITY4</code>,
50 <code class="constant">GL_INTENSITY8</code>,
51 <code class="constant">GL_INTENSITY12</code>,
52 <code class="constant">GL_INTENSITY16</code>,
53 <code class="constant">GL_R3_G3_B2</code>,
54 <code class="constant">GL_RGB</code>,
55 <code class="constant">GL_RGB4</code>,
56 <code class="constant">GL_RGB5</code>,
57 <code class="constant">GL_RGB8</code>,
58 <code class="constant">GL_RGB10</code>,
59 <code class="constant">GL_RGB12</code>,
60 <code class="constant">GL_RGB16</code>,
61 <code class="constant">GL_RGBA</code>,
62 <code class="constant">GL_RGBA2</code>,
63 <code class="constant">GL_RGBA4</code>,
64 <code class="constant">GL_RGB5_A1</code>,
65 <code class="constant">GL_RGBA8</code>,
66 <code class="constant">GL_RGB10_A2</code>,
67 <code class="constant">GL_RGBA12</code>,
68 <code class="constant">GL_RGBA16</code>,
69 <code class="constant">GL_SLUMINANCE</code>,
70 <code class="constant">GL_SLUMINANCE8</code>,
71 <code class="constant">GL_SLUMINANCE_ALPHA</code>,
72 <code class="constant">GL_SLUMINANCE8_ALPHA8</code>,
73 <code class="constant">GL_SRGB</code>,
74 <code class="constant">GL_SRGB8</code>,
75 <code class="constant">GL_SRGB_ALPHA</code>, or
76 <code class="constant">GL_SRGB8_ALPHA8</code>.
77 </p></dd><dt><span class="term"><em class="parameter"><code>width</code></em></span></dt><dd><p>
78 Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
79 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
80
81 <mml:mrow>
82 <mml:msup><mml:mn>2</mml:mn>
83 <mml:mi mathvariant="italic">n</mml:mi>
84 </mml:msup>
85 <mml:mo>+</mml:mo>
86 <mml:mrow>
87 <mml:mn>2</mml:mn>
88 <mml:mo>⁡</mml:mo>
89 <mml:mfenced open="(" close=")">
90 <mml:mi mathvariant="italic">border</mml:mi>
91 </mml:mfenced>
92 </mml:mrow>
93 </mml:mrow>
94 </mml:math>
95 for some integer
96 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>.
97 All
98 implementations support texture images that are at least 64 texels
99 wide.
100 </p></dd><dt><span class="term"><em class="parameter"><code>height</code></em></span></dt><dd><p>
101 Specifies the height of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
102 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
103
104 <mml:mrow>
105 <mml:msup><mml:mn>2</mml:mn>
106 <mml:mi mathvariant="italic">m</mml:mi>
107 </mml:msup>
108 <mml:mo>+</mml:mo>
109 <mml:mrow>
110 <mml:mn>2</mml:mn>
111 <mml:mo>⁡</mml:mo>
112 <mml:mfenced open="(" close=")">
113 <mml:mi mathvariant="italic">border</mml:mi>
114 </mml:mfenced>
115 </mml:mrow>
116 </mml:mrow>
117 </mml:math>
118 for some integer
119 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">m</mml:mi></mml:math>.
120 All
121 implementations support texture images that are at least 64 texels
122 high.
123 </p></dd><dt><span class="term"><em class="parameter"><code>border</code></em></span></dt><dd><p>
124 Specifies the width of the border.
125 Must be either 0 or 1.
126 </p></dd><dt><span class="term"><em class="parameter"><code>format</code></em></span></dt><dd><p>
127 Specifies the format of the pixel data.
128 The following symbolic values are accepted:
129 <code class="constant">GL_COLOR_INDEX</code>,
130 <code class="constant">GL_RED</code>,
131 <code class="constant">GL_GREEN</code>,
132 <code class="constant">GL_BLUE</code>,
133 <code class="constant">GL_ALPHA</code>,
134 <code class="constant">GL_RGB</code>,
135 <code class="constant">GL_BGR</code>,
136 <code class="constant">GL_RGBA</code>,
137 <code class="constant">GL_BGRA</code>,
138 <code class="constant">GL_LUMINANCE</code>, and
139 <code class="constant">GL_LUMINANCE_ALPHA</code>.
140 </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p>
141 Specifies the data type of the pixel data.
142 The following symbolic values are accepted:
143 <code class="constant">GL_UNSIGNED_BYTE</code>,
144 <code class="constant">GL_BYTE</code>,
145 <code class="constant">GL_BITMAP</code>,
146 <code class="constant">GL_UNSIGNED_SHORT</code>,
147 <code class="constant">GL_SHORT</code>,
148 <code class="constant">GL_UNSIGNED_INT</code>,
149 <code class="constant">GL_INT</code>,
150 <code class="constant">GL_FLOAT</code>,
151 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
152 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
153 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>,
154 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>,
155 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
156 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
157 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
158 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
159 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
160 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
161 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, and
162 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>.
163 </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p>
164 Specifies a pointer to the image data in memory.
165 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
166 Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable two-dimensional texturing, call <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> and <a class="citerefentry" href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a> with argument <code class="constant">GL_TEXTURE_2D</code>. To enable and disable texturing using cube-mapped texture, call <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> and <a class="citerefentry" href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a> with argument <code class="constant">GL_TEXTURE_CUBE_MAP</code>.
167 </p><p>
168 To define texture images, call <code class="function">glTexImage2D</code>.
169 The arguments describe the parameters of the texture image,
170 such as height,
171 width,
172 width of the border,
173 level-of-detail number
174 (see <a class="citerefentry" href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>),
175 and number of color components provided.
176 The last three arguments describe how the image is represented in memory;
177 they are identical to the pixel formats used for <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>.
178 </p><p>
179 If <em class="parameter"><code>target</code></em> is <code class="constant">GL_PROXY_TEXTURE_2D</code> or <code class="constant">GL_PROXY_TEXTURE_CUBE_MAP</code>, no data is read from <em class="parameter"><code>data</code></em>, 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 <a class="citerefentry" href="glGetError.xml"><span class="citerefentry"><span class="refentrytitle">glGetError</span></span></a>). To query for an
186 entire mipmap array, use an image array level greater than or equal to
187 1.
188 </p><p>
189 If <em class="parameter"><code>target</code></em> is <code class="constant">GL_TEXTURE_2D</code>, or one of the <code class="constant">GL_TEXTURE_CUBE_MAP</code>
190 targets, data is read from <em class="parameter"><code>data</code></em> as a sequence of signed or unsigned
191 bytes, shorts, or longs, or single-precision floating-point values,
192 depending on <em class="parameter"><code>type</code></em>. These values are grouped into sets of one, two,
193 three, or four values, depending on <em class="parameter"><code>format</code></em>, to form elements. If <em class="parameter"><code>type</code></em>
194 is <code class="constant">GL_BITMAP</code>, the data is considered as a string of unsigned bytes
195 (and <em class="parameter"><code>format</code></em> must be <code class="constant">GL_COLOR_INDEX</code>).
196 Each data byte is treated as eight 1-bit elements,
197 with bit ordering determined by <code class="constant">GL_UNPACK_LSB_FIRST</code>
198 (see <a class="citerefentry" href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>).
199 </p><p>
200 If a non-zero named buffer object is bound to the <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target
201 (see <a class="citerefentry" href="glBindBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>) while a texture image is
202 specified, <em class="parameter"><code>data</code></em> is treated as a byte offset into the buffer object's data store.
203 </p><p>
204 The first element corresponds to the lower left corner of the texture
205 image.
206 Subsequent elements progress left-to-right through the remaining texels
207 in the lowest row of the texture image, and then in successively higher
208 rows of the texture image.
209 The final element corresponds to the upper right corner of the texture
210 image.
211 </p><p>
212 <em class="parameter"><code>format</code></em> determines the composition of each element in <em class="parameter"><code>data</code></em>.
213 It can assume one of these symbolic values:
214 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_COLOR_INDEX</code></span></dt><dd><p>
215 Each element is a single value,
216 a color index.
217 The GL converts it to fixed point
218 (with an unspecified number of zero bits to the right of the binary point),
219 shifted left or right depending on the value and sign of <code class="constant">GL_INDEX_SHIFT</code>,
220 and added to <code class="constant">GL_INDEX_OFFSET</code>
221 (see <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>).
222 The resulting index is converted to a set of color components
223 using the
224 <code class="constant">GL_PIXEL_MAP_I_TO_R</code>,
225 <code class="constant">GL_PIXEL_MAP_I_TO_G</code>,
226 <code class="constant">GL_PIXEL_MAP_I_TO_B</code>, and
227 <code class="constant">GL_PIXEL_MAP_I_TO_A</code> tables,
228 and clamped to the range [0,1].
229 </p></dd><dt><span class="term"><code class="constant">GL_RED</code></span></dt><dd><p>
230 Each element is a single red component.
231 The GL converts it to floating point and assembles it into an RGBA element
232 by attaching 0 for green and blue, and 1 for alpha.
233 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
234 added to the signed bias <code class="constant">GL_c_BIAS</code>,
235 and clamped to the range [0,1]
236 (see <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>).
237 </p></dd><dt><span class="term"><code class="constant">GL_GREEN</code></span></dt><dd><p>
238 Each element is a single green component.
239 The GL converts it to floating point and assembles it into an RGBA element
240 by attaching 0 for red and blue, and 1 for alpha.
241 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
242 added to the signed bias <code class="constant">GL_c_BIAS</code>,
243 and clamped to the range [0,1]
244 (see <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>).
245 </p></dd><dt><span class="term"><code class="constant">GL_BLUE</code></span></dt><dd><p>
246 Each element is a single blue component.
247 The GL converts it to floating point and assembles it into an RGBA element
248 by attaching 0 for red and green, and 1 for alpha.
249 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
250 added to the signed bias <code class="constant">GL_c_BIAS</code>,
251 and clamped to the range [0,1]
252 (see <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>).
253 </p></dd><dt><span class="term"><code class="constant">GL_ALPHA</code></span></dt><dd><p>
254 Each element is a single alpha component.
255 The GL converts it to floating point and assembles it into an RGBA element
256 by attaching 0 for red, green, and blue.
257 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
258 added to the signed bias <code class="constant">GL_c_BIAS</code>,
259 and clamped to the range [0,1]
260 (see <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>).
261 </p></dd><dt><span class="term"><code class="constant">GL_INTENSITY</code></span></dt><dd><p>
262 Each element is a single intensity value.
263 The GL converts it to floating point,
264 then assembles it into an RGBA element by replicating the intensity value
265 three times for red, green, blue, and alpha.
266 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
267 added to the signed bias <code class="constant">GL_c_BIAS</code>,
268 and clamped to the range [0,1]
269 (see <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>).
270 </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>
271 Each element is an RGB triple.
272 The GL converts it to floating point and assembles it into an RGBA element
273 by attaching 1 for alpha.
274 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
275 added to the signed bias <code class="constant">GL_c_BIAS</code>,
276 and clamped to the range [0,1]
277 (see <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>).
278 </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>
279 Each element contains all four components.
280 Each component is multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
281 added to the signed bias <code class="constant">GL_c_BIAS</code>,
282 and clamped to the range [0,1]
283 (see <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>).
284 </p></dd><dt><span class="term"><code class="constant">GL_LUMINANCE</code></span></dt><dd><p>
285 Each element is a single luminance value.
286 The GL converts it to floating point,
287 then assembles it into an RGBA element by replicating the luminance value
288 three times for red, green, and blue and attaching 1 for alpha.
289 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
290 added to the signed bias <code class="constant">GL_c_BIAS</code>,
291 and clamped to the range [0,1]
292 (see <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>).
293 </p></dd><dt><span class="term"><code class="constant">GL_LUMINANCE_ALPHA</code></span></dt><dd><p>
294 Each element is a luminance/alpha pair.
295 The GL converts it to floating point,
296 then assembles it into an RGBA element by replicating the luminance value
297 three times for red, green, and blue.
298 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
299 added to the signed bias <code class="constant">GL_c_BIAS</code>,
300 and clamped to the range [0,1] (see <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>).
301 </p></dd><dt><span class="term"><code class="constant">GL_DEPTH_COMPONENT</code></span></dt><dd><p>
302 Each element is a single depth value.
303 The GL converts it to floating point, multiplies by the signed scale factor
304 <code class="constant">GL_DEPTH_SCALE</code>, adds the signed bias <code class="constant">GL_DEPTH_BIAS</code>,
305 and clamps to the range [0,1] (see <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>).
306 </p></dd></dl></div><p>
307 Refer to the <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a> reference page for a description of
308 the acceptable values for the <em class="parameter"><code>type</code></em> parameter.
309 </p><p>
310 If an application wants to store the texture at a certain
311 resolution or in a certain format, it can request the resolution
312 and format with <em class="parameter"><code>internalFormat</code></em>. The GL will choose an internal
313 representation that closely approximates that requested by <em class="parameter"><code>internalFormat</code></em>, but
314 it may not match exactly.
315 (The representations specified by <code class="constant">GL_LUMINANCE</code>,
316 <code class="constant">GL_LUMINANCE_ALPHA</code>, <code class="constant">GL_RGB</code>,
317 and <code class="constant">GL_RGBA</code> must match exactly. The numeric values 1, 2, 3, and 4
318 may also be used to specify the above representations.)
319 </p><p>
320 If the <em class="parameter"><code>internalFormat</code></em> parameter is one of the generic compressed formats,
321 <code class="constant">GL_COMPRESSED_ALPHA</code>,
322 <code class="constant">GL_COMPRESSED_INTENSITY</code>,
323 <code class="constant">GL_COMPRESSED_LUMINANCE</code>,
324 <code class="constant">GL_COMPRESSED_LUMINANCE_ALPHA</code>,
325 <code class="constant">GL_COMPRESSED_RGB</code>, or
326 <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.
327 </p><p>
328 If the <em class="parameter"><code>internalFormat</code></em> parameter is
329 <code class="constant">GL_SRGB</code>,
330 <code class="constant">GL_SRGB8</code>,
331 <code class="constant">GL_SRGB_ALPHA</code>,
332 <code class="constant">GL_SRGB8_ALPHA8</code>,
333 <code class="constant">GL_SLUMINANCE</code>,
334 <code class="constant">GL_SLUMINANCE8</code>,
335 <code class="constant">GL_SLUMINANCE_ALPHA</code>, or
336 <code class="constant">GL_SLUMINANCE8_ALPHA8</code>, the texture is treated as if the red, green, blue, or luminance components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component
337 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
338 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
339 <mml:mi mathvariant="italic">s</mml:mi>
340 </mml:msub>
341 </mml:math>
342 to a linear component
343 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
344 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
345 <mml:mi mathvariant="italic">l</mml:mi>
346 </mml:msub>
347 </mml:math>
348 is:
349 </p><p>
350 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
351 <mml:mrow>
352 <mml:msub>
353 <mml:mi mathvariant="italic">c</mml:mi>
354 <mml:mi mathvariant="italic">l</mml:mi>
355 </mml:msub>
356 <mml:mo>=</mml:mo>
357 <mml:mrow>
358 <mml:mo>{</mml:mo>
359
360 <mml:mtable columnalign="left">
361 <mml:mtr>
362 <mml:mtd columnalign="left">
363 <mml:mfrac>
364 <mml:msub>
365 <mml:mi mathvariant="italic">c</mml:mi>
366 <mml:mi mathvariant="italic">s</mml:mi>
367 </mml:msub>
368 <mml:mn>12.92</mml:mn>
369 </mml:mfrac>
370 </mml:mtd>
371 <mml:mtd columnalign="left">
372 <mml:mrow>
373 <mml:mspace width="1ex"></mml:mspace>
374 <mml:mo>if</mml:mo>
375 <mml:mspace width="1ex"></mml:mspace>
376 </mml:mrow>
377 <mml:msub>
378 <mml:mi mathvariant="italic">c</mml:mi>
379 <mml:mi mathvariant="italic">s</mml:mi>
380 </mml:msub>
381 <mml:mo>≤</mml:mo>
382 <mml:mn>0.04045</mml:mn>
383 </mml:mtd>
384 </mml:mtr>
385 <mml:mtr>
386 <mml:mtd columnalign="left">
387 <mml:msup>
388 <mml:mrow>
389 <mml:mo>(</mml:mo>
390 <mml:mfrac>
391 <mml:mrow>
392 <mml:msub>
393 <mml:mi>c</mml:mi>
394 <mml:mi>s</mml:mi>
395 </mml:msub>
396 <mml:mo>+</mml:mo>
397 <mml:mn>0.055</mml:mn>
398 </mml:mrow>
399 <mml:mn>1.055</mml:mn>
400 </mml:mfrac>
401 <mml:mo>)</mml:mo>
402 </mml:mrow>
403 <mml:mn>2.4</mml:mn>
404 </mml:msup>
405 </mml:mtd>
406 <mml:mtd columnalign="left">
407 <mml:mrow>
408 <mml:mspace width="1ex"></mml:mspace>
409 <mml:mo>if</mml:mo>
410 <mml:mspace width="1ex"></mml:mspace>
411 </mml:mrow>
412 <mml:msub>
413 <mml:mi mathvariant="italic">c</mml:mi>
414 <mml:mi mathvariant="italic">s</mml:mi>
415 </mml:msub>
416 <mml:mo>&gt;</mml:mo>
417 <mml:mn>0.04045</mml:mn>
418 </mml:mtd>
419 </mml:mtr>
420 </mml:mtable>
421 </mml:mrow>
422 </mml:mrow>
423 </mml:math>
424 </p><p>
425 Assume
426 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
427 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
428 <mml:mi mathvariant="italic">s</mml:mi>
429 </mml:msub>
430 </mml:math>
431 is the sRGB component in the range [0,1].
432 </p><p>
433 Use the <code class="constant">GL_PROXY_TEXTURE_2D</code> or <code class="constant">GL_PROXY_TEXTURE_CUBE_MAP</code> target to try out a resolution and
434 format. The implementation will
435 update and recompute its best match for the requested storage resolution
436 and format. To then query this state, call <a class="citerefentry" href="glGetTexLevelParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexLevelParameter</span></span></a>.
437 If the texture cannot be accommodated, texture state is set to 0.
438 </p><p>
439 A one-component texture image uses only the red component of the RGBA
440 color extracted from <em class="parameter"><code>data</code></em>.
441 A two-component image uses the R and A values.
442 A three-component image uses the R, G, and B values.
443 A four-component image uses all of the RGBA components.
444 </p><p>
445 Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures during texture filtering and application. Image-based shadowing can be enabled by comparing texture r coordinates to depth texture values to generate a boolean result. See <a class="citerefentry" href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a> for details on texture comparison.
446 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
447 Texturing has no effect in color index mode.
448 </p><p>
449 If the <code class="code">ARB_imaging</code> extension is supported, RGBA elements may
450 also be processed by the imaging pipeline. The following stages may be
451 applied to an RGBA color before color component clamping to the range
452 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
453
454 <mml:mfenced open="[" close="]">
455 <mml:mn>0</mml:mn>
456 <mml:mn>1</mml:mn>
457 </mml:mfenced>
458 </mml:math>:
459 </p><div class="variablelist"><dl><dt><span class="term">1. Color component replacement by the color table specified for</span></dt><dd><p>
460 <code class="constant">GL_COLOR_TABLE</code>, if enabled. See <a class="citerefentry" href="glColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glColorTable</span></span></a>.
461 </p></dd><dt><span class="term">2. Two-dimensional Convolution filtering, if enabled.</span></dt><dd><p>
462 See <a class="citerefentry" href="glConvolutionFilter1D.xml"><span class="citerefentry"><span class="refentrytitle">glConvolutionFilter1D</span></span></a>.
463 </p><p>
464 If a convolution filter changes the <em class="parameter"><code>width</code></em> of the texture (by
465 processing with a <code class="constant">GL_CONVOLUTION_BORDER_MODE</code> of <code class="constant">GL_REDUCE</code>, for
466 example), and the GL does not support non-power-of-two textures, the <em class="parameter"><code>width</code></em> must
467 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
468
469 <mml:mrow>
470 <mml:msup><mml:mn>2</mml:mn>
471 <mml:mi mathvariant="italic">n</mml:mi>
472 </mml:msup>
473 <mml:mo>+</mml:mo>
474 <mml:mrow>
475 <mml:mn>2</mml:mn>
476 <mml:mo>⁡</mml:mo>
477 <mml:mfenced open="(" close=")">
478 <mml:mi mathvariant="italic">border</mml:mi>
479 </mml:mfenced>
480 </mml:mrow>
481 </mml:mrow>
482 </mml:math>,
483 for some
484 integer
485 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>,
486 and <em class="parameter"><code>height</code></em> must be
487 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
488
489 <mml:mrow>
490 <mml:msup><mml:mn>2</mml:mn>
491 <mml:mi mathvariant="italic">m</mml:mi>
492 </mml:msup>
493 <mml:mo>+</mml:mo>
494 <mml:mrow>
495 <mml:mn>2</mml:mn>
496 <mml:mo>⁡</mml:mo>
497 <mml:mfenced open="(" close=")">
498 <mml:mi mathvariant="italic">border</mml:mi>
499 </mml:mfenced>
500 </mml:mrow>
501 </mml:mrow>
502 </mml:math>,
503 for some
504 integer
505 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">m</mml:mi></mml:math>,
506 after filtering.
507 </p></dd><dt><span class="term">3. RGBA components may be multiplied by <code class="constant">GL_POST_CONVOLUTION_c_SCALE</code>,</span></dt><dd><p>
508 and added to <code class="constant">GL_POST_CONVOLUTION_c_BIAS</code>, if enabled. See
509 <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>.
510 </p></dd><dt><span class="term">4. Color component replacement by the color table specified for</span></dt><dd><p>
511 <code class="constant">GL_POST_CONVOLUTION_COLOR_TABLE</code>, if enabled. See <a class="citerefentry" href="glColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glColorTable</span></span></a>.
512 </p></dd><dt><span class="term">5. Transformation by the color matrix.</span></dt><dd><p>
513 See <a class="citerefentry" href="glMatrixMode.xml"><span class="citerefentry"><span class="refentrytitle">glMatrixMode</span></span></a>.
514 </p></dd><dt><span class="term">6. RGBA components may be multiplied by <code class="constant">GL_POST_COLOR_MATRIX_c_SCALE</code>,</span></dt><dd><p>
515 and added to <code class="constant">GL_POST_COLOR_MATRIX_c_BIAS</code>, if enabled. See
516 <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>.
517 </p></dd><dt><span class="term">7. Color component replacement by the color table specified for</span></dt><dd><p>
518 <code class="constant">GL_POST_COLOR_MATRIX_COLOR_TABLE</code>, if enabled. See <a class="citerefentry" href="glColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glColorTable</span></span></a>.
519 </p></dd></dl></div><p>
520 The texture image can be represented by the same data formats
521 as the pixels in a <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a> command,
522 except that <code class="constant">GL_STENCIL_INDEX</code>
523 cannot be used.
524 <a class="citerefentry" href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> and <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a> modes affect texture images
525 in exactly the way they affect <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>.
526 </p><p>
527 <code class="function">glTexImage2D</code> and <code class="constant">GL_PROXY_TEXTURE_2D</code> are available only if the GL
528 version is 1.1 or greater.
529 </p><p>
530 Internal formats other than 1, 2, 3, or 4 may be used only if the GL
531 version is 1.1 or greater.
532 </p><p>
533 In GL version 1.1 or greater, <em class="parameter"><code>data</code></em> may be a null pointer.
534 In this case, texture memory is
535 allocated to accommodate a texture of width <em class="parameter"><code>width</code></em> and height <em class="parameter"><code>height</code></em>.
536 You can then download subtextures to initialize this
537 texture memory.
538 The image is undefined if the user tries to apply
539 an uninitialized portion of the texture image to a primitive.
540 </p><p>
541 Formats <code class="constant">GL_BGR</code>, and <code class="constant">GL_BGRA</code> and types
542 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
543 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
544 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>,
545 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>,
546 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
547 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
548 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
549 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
550 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
551 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
552 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, and
553 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code> are available only if the GL version
554 is 1.2 or greater.
555 </p><p>
556 When the <code class="code">ARB_multitexture</code> extension is supported or the GL version is 1.3 or greater, <code class="function">glTexImage2D</code>
557 specifies the two-dimensional texture for the current texture unit,
558 specified with <a class="citerefentry" href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>.
559 </p><p>
560 <code class="constant">GL_TEXTURE_CUBE_MAP</code> and <code class="constant">GL_PROXY_TEXTURE_CUBE_MAP</code> are available only if the GL
561 version is 1.3 or greater.
562 </p><p>
563 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
564 <code class="constant">GL_DEPTH_COMPONENT24</code>, and <code class="constant">GL_DEPTH_COMPONENT32</code> are available only
565 if the GL version is 1.4 or greater.
566 </p><p>
567 Non-power-of-two textures are supported if the GL version is 2.0 or greater, or if the implementation exports the <code class="constant">GL_ARB_texture_non_power_of_two</code> extension.
568 </p><p>
569 The
570 <code class="constant">GL_SRGB</code>,
571 <code class="constant">GL_SRGB8</code>,
572 <code class="constant">GL_SRGB_ALPHA</code>,
573 <code class="constant">GL_SRGB8_ALPHA8</code>,
574 <code class="constant">GL_SLUMINANCE</code>,
575 <code class="constant">GL_SLUMINANCE8</code>,
576 <code class="constant">GL_SLUMINANCE_ALPHA</code>, and
577 <code class="constant">GL_SLUMINANCE8_ALPHA8</code>
578 internal formats are only available if the GL version is 2.1 or greater.
579 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
580 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not <code class="constant">GL_TEXTURE_2D</code>,
581 <code class="constant">GL_PROXY_TEXTURE_2D</code>,
582 <code class="constant">GL_PROXY_TEXTURE_CUBE_MAP</code>,
583 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_X</code>,
584 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_X</code>,
585 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Y</code>,
586 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</code>,
587 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Z</code>, or
588 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</code>.
589 </p><p>
590 <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.
591 </p><p>
592 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not a type constant.
593 </p><p>
594 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is <code class="constant">GL_BITMAP</code> and
595 <em class="parameter"><code>format</code></em> is not <code class="constant">GL_COLOR_INDEX</code>.
596 </p><p>
597 <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
598 or greater than 2 + <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
599 </p><p>
600 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0.
601 </p><p>
602 <code class="constant">GL_INVALID_VALUE</code> may be generated if <em class="parameter"><code>level</code></em> is greater than
603 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
604
605 <mml:mrow>
606 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
607 <mml:mn>2</mml:mn>
608 </mml:msub>
609 <mml:mo>⁡</mml:mo>
610 <mml:mfenced open="(" close=")">
611 <mml:mi mathvariant="italic">max</mml:mi>
612 </mml:mfenced>
613 </mml:mrow>
614 </mml:math>,
615 where <span class="emphasis"><em>max</em></span> is the returned value of <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
616 </p><p>
617 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>internalFormat</code></em> is not 1, 2, 3, 4, or one of the
618 accepted resolution and format symbolic constants.
619 </p><p>
620 <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
621 or greater than 2 + <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
622 </p><p>
623 <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
624 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
625
626 <mml:mrow>
627 <mml:msup><mml:mn>2</mml:mn>
628 <mml:mi mathvariant="italic">k</mml:mi>
629 </mml:msup>
630 <mml:mo>+</mml:mo>
631 <mml:mrow>
632 <mml:mn>2</mml:mn>
633 <mml:mo>⁡</mml:mo>
634 <mml:mfenced open="(" close=")">
635 <mml:mi mathvariant="italic">border</mml:mi>
636 </mml:mfenced>
637 </mml:mrow>
638 </mml:mrow>
639 </mml:math>
640 for some
641 integer value of <span class="emphasis"><em>k</em></span>.
642 </p><p>
643 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>border</code></em> is not 0 or 1.
644 </p><p>
645 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
646 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
647 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
648 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, or
649 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>
650 and <em class="parameter"><code>format</code></em> is not <code class="constant">GL_RGB</code>.
651 </p><p>
652 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
653 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
654 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
655 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
656 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
657 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
658 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
659 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, or
660 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>
661 and <em class="parameter"><code>format</code></em> is neither <code class="constant">GL_RGBA</code> nor <code class="constant">GL_BGRA</code>.
662 </p><p>
663 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>target</code></em> is not
664 <code class="constant">GL_TEXTURE_2D</code> or <code class="constant">GL_PROXY_TEXTURE_2D</code> and <em class="parameter"><code>internalFormat</code></em> is
665 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
666 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32</code>.
667 </p><p>
668 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>format</code></em> is
669 <code class="constant">GL_DEPTH_COMPONENT</code> and <em class="parameter"><code>internalFormat</code></em> is not
670 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
671 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32</code>.
672 </p><p>
673 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>internalFormat</code></em> is
674 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
675 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32</code>, and <em class="parameter"><code>format</code></em> is
676 not <code class="constant">GL_DEPTH_COMPONENT</code>.
677 </p><p>
678 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
679 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped.
680 </p><p>
681 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
682 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer
683 object such that the memory reads required would exceed the data store size.
684 </p><p>
685 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
686 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and <em class="parameter"><code>data</code></em> is not evenly divisible
687 into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>.
688 </p><p>
689 <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glTexImage2D</code>
690 is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a>
691 and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
692 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
693 <a class="citerefentry" href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a>
694 </p><p>
695 <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_TEXTURE_2D</code> or <code class="constant">GL_TEXTURE_CUBE_MAP</code>
696 </p><p>
697 <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PIXEL_UNPACK_BUFFER_BINDING</code>
698 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
699 <a class="citerefentry" href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>,
700 <a class="citerefentry" href="glColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glColorTable</span></span></a>,
701 <a class="citerefentry" href="glConvolutionFilter2D.xml"><span class="citerefentry"><span class="refentrytitle">glConvolutionFilter2D</span></span></a>,
702 <a class="citerefentry" href="glCopyPixels.xml"><span class="citerefentry"><span class="refentrytitle">glCopyPixels</span></span></a>,
703 <a class="citerefentry" href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>,
704 <a class="citerefentry" href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>,
705 <a class="citerefentry" href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>,
706 <a class="citerefentry" href="glCopyTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>,
707 <a class="citerefentry" href="glCopyTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage3D</span></span></a>,
708 <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>,
709 <a class="citerefentry" href="glMatrixMode.xml"><span class="citerefentry"><span class="refentrytitle">glMatrixMode</span></span></a>,
710 <a class="citerefentry" href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>,
711 <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>,
712 <a class="citerefentry" href="glSeparableFilter2D.xml"><span class="citerefentry"><span class="refentrytitle">glSeparableFilter2D</span></span></a>,
713 <a class="citerefentry" href="glTexEnv.xml"><span class="citerefentry"><span class="refentrytitle">glTexEnv</span></span></a>,
714 <a class="citerefentry" href="glTexGen.xml"><span class="citerefentry"><span class="refentrytitle">glTexGen</span></span></a>,
715 <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>,
716 <a class="citerefentry" href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>,
717 <a class="citerefentry" href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>,
718 <a class="citerefentry" href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>,
719 <a class="citerefentry" href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>,
720 <a class="citerefentry" href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>
721 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
722 Copyright <span class="trademark"></span>© 1991-2006
723 Silicon Graphics, Inc. This document is licensed under the SGI
724 Free Software B License. For details, see
725 <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
726 </p></div></div></body></html>