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