rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man4 / 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 4 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 <em class="parameter"><code>internalFormat</code></em> may be one of the base internal formats shown in
166 Table 1, below
167 </p><p>
168 </p><div class="table"><a id="id4865719"></a><p class="title"><b>Table 1. Base Internal Formats</b></p><table summary="Base Internal Formats" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left"><span class="bold"><strong>
169 Base Internal Format
170 </strong></span></th><th align="left"><span class="bold"><strong>
171 RGBA, Depth and Stencil Values
172 </strong></span></th><th align="left"><span class="bold"><strong>
173 Internal Components
174 </strong></span></th></tr></thead><tbody><tr><td align="left"><code class="constant">GL_DEPTH_COMPONENT</code></td><td align="left">Depth</td><td align="left">D</td></tr><tr><td align="left"><code class="constant">GL_DEPTH_STENCIL</code></td><td align="left">Depth, Stencil</td><td align="left">D, S</td></tr><tr><td align="left"><code class="constant">GL_RED</code></td><td align="left">Red</td><td align="left">R</td></tr><tr><td align="left"><code class="constant">GL_RG</code></td><td align="left">Red, Green</td><td align="left">R, G</td></tr><tr><td align="left"><code class="constant">GL_RGB</code></td><td align="left">Red, Green, Blue</td><td align="left">R, G, B</td></tr><tr><td align="left"><code class="constant">GL_RGBA</code></td><td align="left">Red, Green, Blue, Alpha</td><td align="left">R, G, B, A</td></tr></tbody></table></div><p>
175 </p><p>
176 <em class="parameter"><code>internalFormat</code></em> may also be one of the sized internal formats
177 shown in Table 2, below
178 </p><p>
179 </p><div class="table"><a id="id4840913"></a><p class="title"><b>Table 2. Sized Internal Formats</b></p><table summary="Sized Internal Formats" border="1"><colgroup><col align="left" /><col align="left" /><col align="center" /><col align="center" /><col align="center" /><col align="center" /><col align="center" /></colgroup><thead><tr><th align="left"><span class="bold"><strong>
180 Sized Internal Format
181 </strong></span></th><th align="left"><span class="bold"><strong>
182 Base Internal Format
183 </strong></span></th><th align="left"><span class="bold"><strong>
184 Red Bits
185 </strong></span></th><th align="left"><span class="bold"><strong>
186 Green Bits
187 </strong></span></th><th align="left"><span class="bold"><strong>
188 Blue Bits
189 </strong></span></th><th align="left"><span class="bold"><strong>
190 Alpha Bits
191 </strong></span></th><th align="left"><span class="bold"><strong>
192 Shared Bits
193 </strong></span></th></tr></thead><tbody><tr><td align="left"><code class="constant">GL_R8</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R8_SNORM</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">s8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R16</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R16_SNORM</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">s16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG8</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">8</td><td align="center">8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG8_SNORM</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">s8</td><td align="center">s8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG16</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">16</td><td align="center">16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG16_SNORM</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">s16</td><td align="center">s16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R3_G3_B2</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">3</td><td align="center">3</td><td align="center">2</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB4</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">4</td><td align="center">4</td><td align="center">4</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB5</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">5</td><td align="center">5</td><td align="center">5</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB8</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB8_SNORM</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">s8</td><td align="center">s8</td><td align="center">s8</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB10</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">10</td><td align="center">10</td><td align="center">10</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB12</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">12</td><td align="center">12</td><td align="center">12</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB16_SNORM</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">16</td><td align="center">16</td><td align="center">16</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA2</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">2</td><td align="center">2</td><td align="center">2</td><td align="center">2</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA4</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">4</td><td align="center">4</td><td align="center">4</td><td align="center">4</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB5_A1</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">5</td><td align="center">5</td><td align="center">5</td><td align="center">1</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA8</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA8_SNORM</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">s8</td><td align="center">s8</td><td align="center">s8</td><td align="center">s8</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB10_A2</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">10</td><td align="center">10</td><td align="center">10</td><td align="center">2</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB10_A2UI</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">ui10</td><td align="center">ui10</td><td align="center">ui10</td><td align="center">ui2</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA12</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">12</td><td align="center">12</td><td align="center">12</td><td align="center">12</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA16</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">16</td><td align="center">16</td><td align="center">16</td><td align="center">16</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_SRGB8</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_SRGB8_ALPHA8</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R16F</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">f16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG16F</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">f16</td><td align="center">f16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB16F</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">f16</td><td align="center">f16</td><td align="center">f16</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA16F</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">f16</td><td align="center">f16</td><td align="center">f16</td><td align="center">f16</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R32F</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">f32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG32F</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">f32</td><td align="center">f32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB32F</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">f32</td><td align="center">f32</td><td align="center">f32</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA32F</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">f32</td><td align="center">f32</td><td align="center">f32</td><td align="center">f32</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R11F_G11F_B10F</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">f11</td><td align="center">f11</td><td align="center">f10</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB9_E5</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">9</td><td align="center">9</td><td align="center">9</td><td align="center"> </td><td align="center">5</td></tr><tr><td align="left"><code class="constant">GL_R8I</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">i8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R8UI</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">ui8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R16I</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">i16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R16UI</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">ui16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R32I</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">i32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R32UI</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">ui32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG8I</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">i8</td><td align="center">i8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG8UI</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">ui8</td><td align="center">ui8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG16I</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">i16</td><td align="center">i16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG16UI</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">ui16</td><td align="center">ui16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG32I</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">i32</td><td align="center">i32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG32UI</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">ui32</td><td align="center">ui32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB8I</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">i8</td><td align="center">i8</td><td align="center">i8</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB8UI</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">ui8</td><td align="center">ui8</td><td align="center">ui8</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB16I</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">i16</td><td align="center">i16</td><td align="center">i16</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB16UI</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">ui16</td><td align="center">ui16</td><td align="center">ui16</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB32I</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">i32</td><td align="center">i32</td><td align="center">i32</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB32UI</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">ui32</td><td align="center">ui32</td><td align="center">ui32</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA8I</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">i8</td><td align="center">i8</td><td align="center">i8</td><td align="center">i8</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA8UI</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">ui8</td><td align="center">ui8</td><td align="center">ui8</td><td align="center">ui8</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA16I</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">i16</td><td align="center">i16</td><td align="center">i16</td><td align="center">i16</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA16UI</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">ui16</td><td align="center">ui16</td><td align="center">ui16</td><td align="center">ui16</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA32I</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">i32</td><td align="center">i32</td><td align="center">i32</td><td align="center">i32</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA32UI</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">ui32</td><td align="center">ui32</td><td align="center">ui32</td><td align="center">ui32</td><td align="center"> </td></tr></tbody></table></div><p>
194 </p><p>
195 Finally, <em class="parameter"><code>internalFormat</code></em> may also be one of the generic or compressed
196 compressed texture formats shown in Table 3 below
197 </p><p>
198 </p><div class="table"><a id="id4865100"></a><p class="title"><b>Table 3. Compressed Internal Formats</b></p><table summary="Compressed Internal Formats" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left"><span class="bold"><strong>
199 Compressed Internal Format
200 </strong></span></th><th align="left"><span class="bold"><strong>
201 Base Internal Format
202 </strong></span></th><th align="left"><span class="bold"><strong>
203 Type
204 </strong></span></th></tr></thead><tbody><tr><td align="left"><code class="constant">GL_COMPRESSED_RED</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RG</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RGB</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RGBA</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_SRGB</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_SRGB_ALPHA</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RED_RGTC1</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_SIGNED_RED_RGTC1</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RG_RGTC2</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_SIGNED_RG_RGTC2</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RGBA_BPTC_UNORM</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="left">Specific</td></tr></tbody></table></div><p>
205 </p><p>
206 If the <em class="parameter"><code>internalFormat</code></em> parameter is one of the generic compressed formats,
207 <code class="constant">GL_COMPRESSED_RED</code>, <code class="constant">GL_COMPRESSED_RG</code>,
208 <code class="constant">GL_COMPRESSED_RGB</code>, or
209 <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.
210 </p><p>
211 If the <em class="parameter"><code>internalFormat</code></em> parameter is
212 <code class="constant">GL_SRGB</code>,
213 <code class="constant">GL_SRGB8</code>,
214 <code class="constant">GL_SRGB_ALPHA</code>, or
215 <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
216 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
217 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
218 <mml:mi mathvariant="italic">s</mml:mi>
219 </mml:msub>
220 </mml:math>
221 to a linear component
222 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
223 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
224 <mml:mi mathvariant="italic">l</mml:mi>
225 </mml:msub>
226 </mml:math>
227 is:
228 </p><p>
229 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
230 <mml:mrow>
231 <mml:msub>
232 <mml:mi mathvariant="italic">c</mml:mi>
233 <mml:mi mathvariant="italic">l</mml:mi>
234 </mml:msub>
235 <mml:mo>=</mml:mo>
236 <mml:mrow>
237 <mml:mo>{</mml:mo>
238
239 <mml:mtable columnalign="left">
240 <mml:mtr>
241 <mml:mtd columnalign="left">
242 <mml:mfrac>
243 <mml:msub>
244 <mml:mi mathvariant="italic">c</mml:mi>
245 <mml:mi mathvariant="italic">s</mml:mi>
246 </mml:msub>
247 <mml:mn>12.92</mml:mn>
248 </mml:mfrac>
249 </mml:mtd>
250 <mml:mtd columnalign="left">
251 <mml:mrow>
252 <mml:mspace width="1ex"></mml:mspace>
253 <mml:mo>if</mml:mo>
254 <mml:mspace width="1ex"></mml:mspace>
255 </mml:mrow>
256 <mml:msub>
257 <mml:mi mathvariant="italic">c</mml:mi>
258 <mml:mi mathvariant="italic">s</mml:mi>
259 </mml:msub>
260 <mml:mo></mml:mo>
261 <mml:mn>0.04045</mml:mn>
262 </mml:mtd>
263 </mml:mtr>
264 <mml:mtr>
265 <mml:mtd columnalign="left">
266 <mml:msup>
267 <mml:mrow>
268 <mml:mo>(</mml:mo>
269 <mml:mfrac>
270 <mml:mrow>
271 <mml:msub>
272 <mml:mi>c</mml:mi>
273 <mml:mi>s</mml:mi>
274 </mml:msub>
275 <mml:mo>+</mml:mo>
276 <mml:mn>0.055</mml:mn>
277 </mml:mrow>
278 <mml:mn>1.055</mml:mn>
279 </mml:mfrac>
280 <mml:mo>)</mml:mo>
281 </mml:mrow>
282 <mml:mn>2.4</mml:mn>
283 </mml:msup>
284 </mml:mtd>
285 <mml:mtd columnalign="left">
286 <mml:mrow>
287 <mml:mspace width="1ex"></mml:mspace>
288 <mml:mo>if</mml:mo>
289 <mml:mspace width="1ex"></mml:mspace>
290 </mml:mrow>
291 <mml:msub>
292 <mml:mi mathvariant="italic">c</mml:mi>
293 <mml:mi mathvariant="italic">s</mml:mi>
294 </mml:msub>
295 <mml:mo>&gt;</mml:mo>
296 <mml:mn>0.04045</mml:mn>
297 </mml:mtd>
298 </mml:mtr>
299 </mml:mtable>
300 </mml:mrow>
301 </mml:mrow>
302 </mml:math>
303 </p><p>
304 Assume
305 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
306 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
307 <mml:mi mathvariant="italic">s</mml:mi>
308 </mml:msub>
309 </mml:math>
310 is the sRGB component in the range [0,1].
311 </p><p>
312 Use the <code class="constant">GL_PROXY_TEXTURE_2D</code>, <code class="constant">GL_PROXY_TEXTURE_1D_ARRAY</code>,
313 <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
314 format. The implementation will
315 update and recompute its best match for the requested storage resolution
316 and format. To then query this state, call <a href="glGetTexLevelParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexLevelParameter</span></span></a>.
317 If the texture cannot be accommodated, texture state is set to 0.
318 </p><p>
319 A one-component texture image uses only the red component of the RGBA
320 color extracted from <em class="parameter"><code>data</code></em>.
321 A two-component image uses the R and G values.
322 A three-component image uses the R, G, and B values.
323 A four-component image uses all of the RGBA components.
324 </p><p>
325 Image-based shadowing can be enabled by comparing texture r coordinates to
326 depth texture values to generate a boolean result.
327 See <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a> for details on texture comparison.
328 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
329 The <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> mode affects texture images.
330 </p><p>
331 <em class="parameter"><code>data</code></em> may be a null pointer.
332 In this case, texture memory is
333 allocated to accommodate a texture of width <em class="parameter"><code>width</code></em> and height <em class="parameter"><code>height</code></em>.
334 You can then download subtextures to initialize this
335 texture memory.
336 The image is undefined if the user tries to apply
337 an uninitialized portion of the texture image to a primitive.
338 </p><p>
339 <code class="function">glTexImage2D</code> specifies the two-dimensional texture for the current texture unit,
340 specified with <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>.
341 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
342 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not
343 <code class="constant">GL_TEXTURE_2D</code>,
344 <code class="constant">GL_TEXTURE_1D_ARRAY</code>,
345 <code class="constant">GL_TEXTURE_RECTANGLE</code>,
346 <code class="constant">GL_PROXY_TEXTURE_2D</code>,
347 <code class="constant">GL_PROXY_TEXTURE_1D_ARRAY</code>,
348 <code class="constant">GL_PROXY_TEXTURE_RECTANGLE</code>,
349 <code class="constant">GL_PROXY_TEXTURE_CUBE_MAP</code>,
350 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_X</code>,
351 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_X</code>,
352 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Y</code>,
353 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</code>,
354 <code class="constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Z</code>, or
355 <code class="constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</code>.
356 </p><p>
357 <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.
358 </p><p>
359 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not a type constant.
360 </p><p>
361 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>width</code></em> is less than 0
362 or greater than <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
363 </p><p>
364 <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
365 <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>.
366 </p><p>
367 <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
368 <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>.
369 </p><p>
370 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0.
371 </p><p>
372 <code class="constant">GL_INVALID_VALUE</code> may be generated if <em class="parameter"><code>level</code></em> is greater than
373 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
374
375 <mml:mrow>
376 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
377 <mml:mn>2</mml:mn>
378 </mml:msub>
379 <mml:mo></mml:mo>
380 <mml:mfenced open="(" close=")">
381 <mml:mi mathvariant="italic">max</mml:mi>
382 </mml:mfenced>
383 </mml:mrow>
384 </mml:math>,
385 where <span class="emphasis"><em>max</em></span> is the returned value of <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
386 </p><p>
387 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>internalFormat</code></em> is not one of the
388 accepted resolution and format symbolic constants.
389 </p><p>
390 <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
391 or greater than <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
392 </p><p>
393 <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
394 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
395
396 <mml:mrow>
397 <mml:msup><mml:mn>2</mml:mn>
398 <mml:mi mathvariant="italic">k</mml:mi>
399 </mml:msup>
400 <mml:mo>+</mml:mo>
401 <mml:mrow>
402 <mml:mn>2</mml:mn>
403 <mml:mo></mml:mo>
404 <mml:mfenced open="(" close=")">
405 <mml:mi mathvariant="italic">border</mml:mi>
406 </mml:mfenced>
407 </mml:mrow>
408 </mml:mrow>
409 </mml:math>
410 for some
411 integer value of <span class="emphasis"><em>k</em></span>.
412 </p><p>
413 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>border</code></em> is not 0.
414 </p><p>
415 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
416 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
417 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
418 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>,
419 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>, or
420 <code class="constant">GL_UNSIGNED_INT_10F_11F_11F_REV</code>,
421 and <em class="parameter"><code>format</code></em> is not <code class="constant">GL_RGB</code>.
422 </p><p>
423 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
424 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
425 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
426 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
427 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
428 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
429 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
430 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>,
431 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>, or
432 <code class="constant">GL_UNSIGNED_INT_5_9_9_9_REV</code>,
433 and <em class="parameter"><code>format</code></em> is neither <code class="constant">GL_RGBA</code> nor <code class="constant">GL_BGRA</code>.
434 </p><p>
435 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>target</code></em> is not
436 <code class="constant">GL_TEXTURE_2D</code>, <code class="constant">GL_PROXY_TEXTURE_2D</code>,
437 <code class="constant">GL_TEXTURE_RECTANGLE</code>, or <code class="constant">GL_PROXY_TEXTURE_RECTANGLE</code>,
438 and <em class="parameter"><code>internalFormat</code></em> is
439 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
440 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32F</code>.
441 </p><p>
442 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>format</code></em> is
443 <code class="constant">GL_DEPTH_COMPONENT</code> and <em class="parameter"><code>internalFormat</code></em> is not
444 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
445 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32F</code>.
446 </p><p>
447 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>internalFormat</code></em> is
448 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
449 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32F</code>, and <em class="parameter"><code>format</code></em> is
450 not <code class="constant">GL_DEPTH_COMPONENT</code>.
451 </p><p>
452 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
453 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped.
454 </p><p>
455 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
456 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer
457 object such that the memory reads required would exceed the data store size.
458 </p><p>
459 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
460 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and <em class="parameter"><code>data</code></em> is not evenly divisible
461 into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>.
462 </p><p>
463 <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>
464 or <code class="constant">GL_PROXY_TEXTURE_RECTANGLE</code> and <em class="parameter"><code>level</code></em> is not 0.
465 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
466 <a href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a>
467 </p><p>
468 <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>
469 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
470 <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>,
471 <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>,
472 <a href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>,
473 <a href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>,
474 <a href="glCopyTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>,
475 <a href="glCopyTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage3D</span></span></a>,
476 <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>,
477 <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>,
478 <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>,
479 <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>,
480 <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>,
481 <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>,
482 <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>
483 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
484 Copyright <span class="trademark"></span>© 1991-2006 Silicon Graphics, Inc.
485 Copyright <span class="trademark"></span>© 2011 Khronos Group.
486 This document is licensed under the SGI
487 Free Software B License. For details, see
488 <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
489 </p></div></div></body></html>