rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / glCompressedTexImage2D.xml
CommitLineData
7faf1d71
AW
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_CUBE_MAP_POSITIVE_X</constant>,
44 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>,
45 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>,
46 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>,
47 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>,
48 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>, or
49 <constant>GL_PROXY_TEXTURE_CUBE_MAP</constant>.
50 </para>
51 </listitem>
52 </varlistentry>
53 <varlistentry>
54 <term><parameter>level</parameter></term>
55 <listitem>
56 <para>
57 Specifies the level-of-detail number.
58 Level 0 is the base image level.
59 Level <emphasis>n</emphasis> is the <emphasis>n</emphasis>th mipmap reduction image.
60 </para>
61 </listitem>
62 </varlistentry>
63 <varlistentry>
64 <term><parameter>internalformat</parameter></term>
65 <listitem>
66 <para>
67 Specifies the format of the compressed image data stored at address <parameter>data</parameter>.
68 </para>
69 </listitem>
70 </varlistentry>
71 <varlistentry>
72 <term><parameter>width</parameter></term>
73 <listitem>
74 <para>
75 Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
76 <inlineequation><mml:math>
77 <!-- eqn: 2 sup n + 2 ( border ):-->
78 <mml:mrow>
79 <mml:msup><mml:mn>2</mml:mn>
80 <mml:mi mathvariant="italic">n</mml:mi>
81 </mml:msup>
82 <mml:mo>+</mml:mo>
83 <mml:mrow>
84 <mml:mn>2</mml:mn>
85 <mml:mo>&af;</mml:mo>
86 <mml:mfenced open="(" close=")">
87 <mml:mi mathvariant="italic">border</mml:mi>
88 </mml:mfenced>
89 </mml:mrow>
90 </mml:mrow>
91 </mml:math></inlineequation>
92 for some integer
93 <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>.
94 All
95 implementations support 2D texture images that are at least 64 texels
96 wide and cube-mapped texture images that are at least 16 texels wide.
97 </para>
98 </listitem>
99 </varlistentry>
100 <varlistentry>
101 <term><parameter>height</parameter></term>
102 <listitem>
103 <para>
104 Specifies the height of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
105 Must be
106 <inlineequation><mml:math>
107 <!-- eqn: 2 sup n + 2 ( border ):-->
108 <mml:mrow>
109 <mml:msup><mml:mn>2</mml:mn>
110 <mml:mi mathvariant="italic">n</mml:mi>
111 </mml:msup>
112 <mml:mo>+</mml:mo>
113 <mml:mrow>
114 <mml:mn>2</mml:mn>
115 <mml:mo>&af;</mml:mo>
116 <mml:mfenced open="(" close=")">
117 <mml:mi mathvariant="italic">border</mml:mi>
118 </mml:mfenced>
119 </mml:mrow>
120 </mml:mrow>
121 </mml:math></inlineequation>
122 for some integer
123 <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>.
124 All
125 implementations support 2D texture images that are at least 64 texels
126 high and cube-mapped texture images that are at least 16 texels high.
127 </para>
128 </listitem>
129 </varlistentry>
130 <varlistentry>
131 <term><parameter>border</parameter></term>
132 <listitem>
133 <para>
134 Specifies the width of the border.
135 Must be either 0 or 1.
136 </para>
137 </listitem>
138 </varlistentry>
139 <varlistentry>
140 <term><parameter>imageSize</parameter></term>
141 <listitem>
142 <para>
143 Specifies the number of unsigned bytes of image data starting at the
144 address specified by <parameter>data</parameter>.
145 </para>
146 </listitem>
147 </varlistentry>
148 <varlistentry>
149 <term><parameter>data</parameter></term>
150 <listitem>
151 <para>
152 Specifies a pointer to the compressed image data in memory.
153 </para>
154 </listitem>
155 </varlistentry>
156 </variablelist>
157 </refsect1>
158 <refsect1 id="description"><title>Description</title>
159 <para>
160 Texturing maps a portion of a specified texture image onto each graphical
161 primitive for which texturing is enabled. To enable and disable
162 two-dimensional texturing, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument
163 <constant>GL_TEXTURE_2D</constant>. To enable and disable texturing using
164 cube-mapped textures, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument
165 <constant>GL_TEXTURE_CUBE_MAP</constant>.
166 </para>
167 <para>
168 <function>glCompressedTexImage2D</function> loads a previously defined, and retrieved, compressed two-dimensional
169 texture image if <parameter>target</parameter> is <constant>GL_TEXTURE_2D</constant> (see <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>).
170 </para>
171 <para>
172 If <parameter>target</parameter> is <constant>GL_PROXY_TEXTURE_2D</constant>, no data is read from <parameter>data</parameter>, but
173 all of the texture image state is recalculated, checked for consistency,
174 and checked against the implementation's capabilities. If the
175 implementation cannot handle a texture of the requested texture size, it
176 sets all of the image state to 0, but does not generate an error (see
177 <citerefentry><refentrytitle>glGetError</refentrytitle></citerefentry>). To query for an entire mipmap array, use an image array level
178 greater than or equal to 1.
179 </para>
180 <para>
181 <parameter>internalformat</parameter> must be an extension-specified compressed-texture format.
182 When a texture is loaded with <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry> using a generic compressed
183 texture format (e.g., <constant>GL_COMPRESSED_RGB</constant>), the GL selects from one of
184 its extensions supporting compressed textures. In order to load the
185 compressed texture image using <function>glCompressedTexImage2D</function>, query the compressed texture image's
186 size and format using <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry>.
187 </para>
188 <para>
189 If a non-zero named buffer object is bound to the <constant>GL_PIXEL_UNPACK_BUFFER</constant> target
190 (see <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>) while a texture image is
191 specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
192 </para>
193 </refsect1>
194 <refsect1 id="notes"><title>Notes</title>
195 <para>
196 <function>glCompressedTexImage2D</function> is available only if the GL version is 1.3 or greater.
197 </para>
198 <para>
199 Non-power-of-two textures are supported if the GL version is 2.0 or greater, or if the implementation exports the <constant>GL_ARB_texture_non_power_of_two</constant> extension.
200 </para>
201 </refsect1>
202 <refsect1 id="errors"><title>Errors</title>
203 <para>
204 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is one of the generic compressed internal formats: <constant>GL_COMPRESSED_ALPHA</constant>,
205 <constant>GL_COMPRESSED_LUMINANCE</constant>, <constant>GL_COMPRESSED_LUMINANCE_ALPHA</constant>,
206 <constant>GL_COMPRESSED_INTENSITY</constant>, <constant>GL_COMPRESSED_RGB</constant>, or
207 <constant>GL_COMPRESSED_RGBA</constant>.
208 </para>
209 <para>
210 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>imageSize</parameter> is not consistent with
211 the format, dimensions, and contents of the specified compressed image
212 data.
213 </para>
214 <para>
215 <constant>GL_INVALID_OPERATION</constant> is generated if parameter combinations are not
216 supported by the specific compressed internal format as specified in the
217 specific texture compression extension.
218 </para>
219 <para>
220 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
221 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the buffer object's data store is currently mapped.
222 </para>
223 <para>
224 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
225 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
226 object such that the memory reads required would exceed the data store size.
227 </para>
228 <para>
229 <constant>GL_INVALID_OPERATION</constant> is generated if <function>glCompressedTexImage2D</function>
230 is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
231 and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
232 </para>
233 <para>
234 Undefined results, including abnormal program termination, are generated if
235 <parameter>data</parameter> is not encoded in a manner consistent with the extension
236 specification defining the internal compression format.
237 </para>
238 </refsect1>
239 <refsect1 id="associatedgets"><title>Associated Gets</title>
240 <para>
241 <citerefentry><refentrytitle>glGetCompressedTexImage</refentrytitle></citerefentry>
242 </para>
243 <para>
244 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_COMPRESSED</constant>
245 </para>
246 <para>
247 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_UNPACK_BUFFER_BINDING</constant>
248 </para>
249 <para>
250 <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry> with arguments <constant>GL_TEXTURE_INTERNAL_FORMAT</constant>
251 and <constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE</constant>
252 </para>
253 <para>
254 <citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument
255 <constant>GL_TEXTURE_2D</constant> or <constant>GL_TEXTURE_CUBE_MAP</constant>
256 </para>
257 </refsect1>
258 <refsect1 id="seealso"><title>See Also</title>
259 <para>
260 <citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
261 <citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>,
262 <citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>,
263 <citerefentry><refentrytitle>glCompressedTexImage3D</refentrytitle></citerefentry>,
264 <citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>,
265 <citerefentry><refentrytitle>glCompressedTexSubImage2D</refentrytitle></citerefentry>,
266 <citerefentry><refentrytitle>glCompressedTexSubImage3D</refentrytitle></citerefentry>,
267 <citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>,
268 <citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
269 <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
270 <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
271 <citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
272 <citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
273 <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
274 <citerefentry><refentrytitle>glMatrixMode</refentrytitle></citerefentry>,
275 <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
276 <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
277 <citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
278 <citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
279 <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
280 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
281 <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
282 <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>,
283 <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>,
284 <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>
285 </para>
286 </refsect1>
287 <refsect1 id="Copyright"><title>Copyright</title>
288 <para>
289 Copyright <trademark class="copyright"></trademark> 1991-2006
290 Silicon Graphics, Inc. This document is licensed under the SGI
291 Free Software B License. For details, see
292 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
293 </para>
294 </refsect1>
295</refentry>