rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man3 / glCompressedTexImage2D.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id="glCompressedTexImage2D">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glCompressedTexImage2D</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glCompressedTexImage2D</refname>
17 <refpurpose>specify a two-dimensional texture image in a compressed format</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glCompressedTexImage2D</function></funcdef>
23 <paramdef>GLenum <parameter>target</parameter></paramdef>
24 <paramdef>GLint <parameter>level</parameter></paramdef>
25 <paramdef>GLenum <parameter>internalformat</parameter></paramdef>
26 <paramdef>GLsizei <parameter>width</parameter></paramdef>
27 <paramdef>GLsizei <parameter>height</parameter></paramdef>
28 <paramdef>GLint <parameter>border</parameter></paramdef>
29 <paramdef>GLsizei <parameter>imageSize</parameter></paramdef>
30 <paramdef>const GLvoid * <parameter>data</parameter></paramdef>
31 </funcprototype>
32 </funcsynopsis>
33 </refsynopsisdiv>
34 <!-- eqn: ignoring delim $$ -->
35 <refsect1 id="parameters"><title>Parameters</title>
36 <variablelist>
37 <varlistentry>
38 <term><parameter>target</parameter></term>
39 <listitem>
40 <para>
41 Specifies the target texture.
42 Must be <constant>GL_TEXTURE_2D</constant>, <constant>GL_PROXY_TEXTURE_2D</constant>,
43 <constant>GL_TEXTURE_1D_ARRAY</constant>, <constant>GL_PROXY_TEXTURE_1D_ARRAY</constant>,
44 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>,
45 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>,
46 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>,
47 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>,
48 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>,
49 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>, or
50 <constant>GL_PROXY_TEXTURE_CUBE_MAP</constant>.
51 </para>
52 </listitem>
53 </varlistentry>
54 <varlistentry>
55 <term><parameter>level</parameter></term>
56 <listitem>
57 <para>
58 Specifies the level-of-detail number.
59 Level 0 is the base image level.
60 Level <emphasis>n</emphasis> is the <emphasis>n</emphasis>th mipmap reduction image.
61 </para>
62 </listitem>
63 </varlistentry>
64 <varlistentry>
65 <term><parameter>internalformat</parameter></term>
66 <listitem>
67 <para>
68 Specifies the format of the compressed image data stored at address <parameter>data</parameter>.
69 </para>
70 </listitem>
71 </varlistentry>
72 <varlistentry>
73 <term><parameter>width</parameter></term>
74 <listitem>
75 <para>
76 Specifies the width of the texture image.
77 All implementations support 2D texture images that are at least 64 texels
78 wide and cube-mapped texture images that are at least 16 texels wide.
79 </para>
80 </listitem>
81 </varlistentry>
82 <varlistentry>
83 <term><parameter>height</parameter></term>
84 <listitem>
85 <para>
86 Specifies the height of the texture image.
87 All implementations support 2D texture images that are at least 64 texels
88 high and cube-mapped texture images that are at least 16 texels high.
89 </para>
90 </listitem>
91 </varlistentry>
92 <varlistentry>
93 <term><parameter>border</parameter></term>
94 <listitem>
95 <para>
96 This value must be 0.
97 </para>
98 </listitem>
99 </varlistentry>
100 <varlistentry>
101 <term><parameter>imageSize</parameter></term>
102 <listitem>
103 <para>
104 Specifies the number of unsigned bytes of image data starting at the
105 address specified by <parameter>data</parameter>.
106 </para>
107 </listitem>
108 </varlistentry>
109 <varlistentry>
110 <term><parameter>data</parameter></term>
111 <listitem>
112 <para>
113 Specifies a pointer to the compressed image data in memory.
114 </para>
115 </listitem>
116 </varlistentry>
117 </variablelist>
118 </refsect1>
119 <refsect1 id="description"><title>Description</title>
120 <para>
121 Texturing allows elements of an image array to be read by shaders.
122 </para>
123 <para>
124 <function>glCompressedTexImage2D</function> loads a previously defined, and retrieved, compressed two-dimensional
125 texture image if <parameter>target</parameter> is <constant>GL_TEXTURE_2D</constant>, or one of the
126 cube map faces such as <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>.
127 (see <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>).
128 </para>
129 <para>
130 If <parameter>target</parameter> is <constant>GL_TEXTURE_1D_ARRAY</constant>, <parameter>data</parameter>
131 is treated as an array of compressed 1D textures.
132 </para>
133 <para>
134 If <parameter>target</parameter> is <constant>GL_PROXY_TEXTURE_2D</constant>, <constant>GL_PROXY_TEXTURE_1D_ARRAY</constant>
135 or <constant>GL_PROXY_CUBE_MAP</constant>, no data is read from <parameter>data</parameter>, but
136 all of the texture image state is recalculated, checked for consistency,
137 and checked against the implementation's capabilities. If the
138 implementation cannot handle a texture of the requested texture size, it
139 sets all of the image state to 0, but does not generate an error (see
140 <citerefentry><refentrytitle>glGetError</refentrytitle></citerefentry>). To query for an entire mipmap array,
141 use an image array level greater than or equal to 1.
142 </para>
143 <para>
144 <parameter>internalformat</parameter> must be a known compressed image format (such as <constant>GL_RGTC</constant>)
145 or an extension-specified compressed-texture format.
146 When a texture is loaded with <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry> using a generic compressed
147 texture format (e.g., <constant>GL_COMPRESSED_RGB</constant>), the GL selects from one of
148 its extensions supporting compressed textures. In order to load the
149 compressed texture image using <function>glCompressedTexImage2D</function>, query the compressed texture image's
150 size and format using <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry>.
151 </para>
152 <para>
153 If a non-zero named buffer object is bound to the <constant>GL_PIXEL_UNPACK_BUFFER</constant> target
154 (see <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>) while a texture image is
155 specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
156 </para>
157 </refsect1>
158 <refsect1 id="errors"><title>Errors</title>
159 <para>
160 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is not one of the generic
161 compressed internal formats:
162 <constant>GL_COMPRESSED_RED</constant>,
163 <constant>GL_COMPRESSED_RG</constant>,
164 <constant>GL_COMPRESSED_RGB</constant>,
165 <constant>GL_COMPRESSED_RGBA</constant>.
166 <constant>GL_COMPRESSED_SRGB</constant>, or
167 <constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
168 </para>
169 <para>
170 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>imageSize</parameter> is not consistent with
171 the format, dimensions, and contents of the specified compressed image
172 data.
173 </para>
174 <para>
175 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>border</parameter> is not 0.
176 </para>
177 <para>
178 <constant>GL_INVALID_OPERATION</constant> is generated if parameter combinations are not
179 supported by the specific compressed internal format as specified in the
180 specific texture compression extension.
181 </para>
182 <para>
183 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
184 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the buffer object's data store is currently mapped.
185 </para>
186 <para>
187 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
188 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
189 object such that the memory reads required would exceed the data store size.
190 </para>
191 <para>
192 Undefined results, including abnormal program termination, are generated if
193 <parameter>data</parameter> is not encoded in a manner consistent with the extension
194 specification defining the internal compression format.
195 </para>
196 </refsect1>
197 <refsect1 id="associatedgets"><title>Associated Gets</title>
198 <para>
199 <citerefentry><refentrytitle>glGetCompressedTexImage</refentrytitle></citerefentry>
200 </para>
201 <para>
202 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_COMPRESSED</constant>
203 </para>
204 <para>
205 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_UNPACK_BUFFER_BINDING</constant>
206 </para>
207 <para>
208 <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry> with arguments <constant>GL_TEXTURE_INTERNAL_FORMAT</constant>
209 and <constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE</constant>
210 </para>
211 </refsect1>
212 <refsect1 id="seealso"><title>See Also</title>
213 <para>
214 <citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
215 <citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>,
216 <citerefentry><refentrytitle>glCompressedTexImage3D</refentrytitle></citerefentry>,
217 <citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>,
218 <citerefentry><refentrytitle>glCompressedTexSubImage2D</refentrytitle></citerefentry>,
219 <citerefentry><refentrytitle>glCompressedTexSubImage3D</refentrytitle></citerefentry>,
220 <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
221 <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
222 <citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
223 <citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
224 <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
225 <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
226 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
227 <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
228 <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>,
229 <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>,
230 <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>
231 </para>
232 </refsect1>
233 <refsect1 id="Copyright"><title>Copyright</title>
234 <para>
235 Copyright <trademark class="copyright"></trademark> 1991-2006
236 Silicon Graphics, Inc. This document is licensed under the SGI
237 Free Software B License. For details, see
238 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
239 </para>
240 </refsect1>
241 </refentry>