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=
"glCompressedTexSubImage2D">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glCompressedTexSubImage2D
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glCompressedTexSubImage2D
</refname>
17 <refpurpose>specify a two-dimensional texture subimage in a compressed format
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glCompressedTexSubImage2D
</function></funcdef>
23 <paramdef>GLenum
<parameter>target
</parameter></paramdef>
24 <paramdef>GLint
<parameter>level
</parameter></paramdef>
25 <paramdef>GLint
<parameter>xoffset
</parameter></paramdef>
26 <paramdef>GLint
<parameter>yoffset
</parameter></paramdef>
27 <paramdef>GLsizei
<parameter>width
</parameter></paramdef>
28 <paramdef>GLsizei
<parameter>height
</parameter></paramdef>
29 <paramdef>GLenum
<parameter>format
</parameter></paramdef>
30 <paramdef>GLsizei
<parameter>imageSize
</parameter></paramdef>
31 <paramdef>const GLvoid *
<parameter>data
</parameter></paramdef>
35 <!-- eqn: ignoring delim $$ -->
36 <refsect1 id=
"parameters"><title>Parameters
</title>
39 <term><parameter>target
</parameter></term>
42 Specifies the target texture.
43 Must be
<constant>GL_TEXTURE_2D
</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>, or
49 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
</constant>.
54 <term><parameter>level
</parameter></term>
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.
64 <term><parameter>xoffset
</parameter></term>
67 Specifies a texel offset in the x direction within the texture array.
72 <term><parameter>yoffset
</parameter></term>
75 Specifies a texel offset in the y direction within the texture array.
80 <term><parameter>width
</parameter></term>
83 Specifies the width of the texture subimage.
88 <term><parameter>height
</parameter></term>
91 Specifies the height of the texture subimage.
96 <term><parameter>format
</parameter></term>
99 Specifies the format of the compressed image data stored at address
<parameter>data
</parameter>.
104 <term><parameter>imageSize
</parameter></term>
107 Specifies the number of unsigned bytes of image data starting at the
108 address specified by
<parameter>data
</parameter>.
113 <term><parameter>data
</parameter></term>
116 Specifies a pointer to the compressed image data in memory.
122 <refsect1 id=
"description"><title>Description
</title>
124 Texturing maps a portion of a specified texture image onto each graphical
125 primitive for which texturing is enabled. To enable and disable
126 two-dimensional texturing, call
<citerefentry><refentrytitle>glEnable
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glDisable
</refentrytitle></citerefentry> with argument
127 <constant>GL_TEXTURE_2D
</constant>. To enable and disable texturing using
128 cube-mapped texture, call
<citerefentry><refentrytitle>glEnable
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glDisable
</refentrytitle></citerefentry> with argument
129 <constant>GL_TEXTURE_CUBE_MAP
</constant>.
132 <function>glCompressedTexSubImage2D
</function> redefines a contiguous subregion of an existing two-dimensional
133 texture image. The texels referenced by
<parameter>data
</parameter> replace the portion of the
134 existing texture array with x indices
<parameter>xoffset
</parameter> and
135 <inlineequation><mml:math>
136 <!-- eqn: xoffset + width - 1:-->
138 <mml:mi mathvariant=
"italic">xoffset
</mml:mi>
140 <mml:mi mathvariant=
"italic">width
</mml:mi>
144 </mml:math></inlineequation>,
145 and the y indices
<parameter>yoffset
</parameter> and
146 <inlineequation><mml:math>
147 <!-- eqn: yoffset + height - 1:-->
149 <mml:mi mathvariant=
"italic">yoffset
</mml:mi>
151 <mml:mi mathvariant=
"italic">height
</mml:mi>
155 </mml:math></inlineequation>,
157 This region may not include any texels
158 outside the range of the texture array as it was originally specified. It
159 is not an error to specify a subtexture with width of
0, but such a
160 specification has no effect.
163 <parameter>format
</parameter> must be an extension-specified
164 compressed-texture format. The
<parameter>format
</parameter> of the compressed texture
165 image is selected by the GL implementation that compressed it (see
166 <citerefentry><refentrytitle>glTexImage2D
</refentrytitle></citerefentry>) and should be queried at the time the texture was
167 compressed with
<citerefentry><refentrytitle>glGetTexLevelParameter
</refentrytitle></citerefentry>.
170 If a non-zero named buffer object is bound to the
<constant>GL_PIXEL_UNPACK_BUFFER
</constant> target
171 (see
<citerefentry><refentrytitle>glBindBuffer
</refentrytitle></citerefentry>) while a texture image is
172 specified,
<parameter>data
</parameter> is treated as a byte offset into the buffer object's data store.
175 <refsect1 id=
"notes"><title>Notes
</title>
177 <function>glCompressedTexSubImage2D
</function> is available only if the GL version is
1.3 or greater.
180 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X
</constant>,
181 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X
</constant>,
182 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y
</constant>,
183 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
</constant>,
184 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z
</constant>,
185 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
</constant>, or
186 <constant>GL_PROXY_TEXTURE_CUBE_MAP
</constant> are available only if the GL version is
1.3
190 <refsect1 id=
"errors"><title>Errors
</title>
192 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>format
</parameter> is one of these generic compressed internal formats:
193 <constant>GL_COMPRESSED_ALPHA
</constant>,
194 <constant>GL_COMPRESSED_LUMINANCE
</constant>,
195 <constant>GL_COMPRESSED_LUMINANCE_ALPHA
</constant>,
196 <constant>GL_COMPRESSED_INTENSITY
</constant>,
197 <constant>GL_COMPRESSED_RGB
</constant>,
198 <constant>GL_COMPRESSED_RGBA
</constant>,
199 <constant>GL_COMPRESSED_SLUMINANCE
</constant>,
200 <constant>GL_COMPRESSED_SLUMINANCE_ALPHA
</constant>,
201 <constant>GL_COMPRESSED_SRGB
</constant>,
202 <constant>GL_COMPRESSED_SRGBA
</constant>, or
203 <constant>GL_COMPRESSED_SRGB_ALPHA
</constant>.
206 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>imageSize
</parameter> is not consistent with
207 the format, dimensions, and contents of the specified compressed image
211 <constant>GL_INVALID_OPERATION
</constant> is generated if parameter combinations are not
212 supported by the specific compressed internal format as specified in the
213 specific texture compression extension.
216 <constant>GL_INVALID_OPERATION
</constant> is generated if a non-zero buffer object name is bound to the
217 <constant>GL_PIXEL_UNPACK_BUFFER
</constant> target and the buffer object's data store is currently mapped.
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 data would be unpacked from the buffer
222 object such that the memory reads required would exceed the data store size.
225 <constant>GL_INVALID_OPERATION
</constant> is generated if
<function>glCompressedTexSubImage2D
</function>
226 is executed between the execution of
<citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
227 and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
230 Undefined results, including abnormal program termination, are generated if
231 <parameter>data
</parameter> is not encoded in a manner consistent with the extension
232 specification defining the internal compression format.
235 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
237 <citerefentry><refentrytitle>glGetCompressedTexImage
</refentrytitle></citerefentry>
240 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_COMPRESSED
</constant>
243 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_PIXEL_UNPACK_BUFFER_BINDING
</constant>
246 <citerefentry><refentrytitle>glGetTexLevelParameter
</refentrytitle></citerefentry> with arguments
<constant>GL_TEXTURE_INTERNAL_FORMAT
</constant>
247 and
<constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE
</constant>
250 <citerefentry><refentrytitle>glIsEnabled
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_2D
</constant> or
<constant>GL_TEXTURE_CUBE_MAP
</constant>
253 <refsect1 id=
"seealso"><title>See Also
</title>
255 <citerefentry><refentrytitle>glActiveTexture
</refentrytitle></citerefentry>,
256 <citerefentry><refentrytitle>glColorTable
</refentrytitle></citerefentry>,
257 <citerefentry><refentrytitle>glCompressedTexImage1D
</refentrytitle></citerefentry>,
258 <citerefentry><refentrytitle>glCompressedTexImage2D
</refentrytitle></citerefentry>,
259 <citerefentry><refentrytitle>glCompressedTexImage3D
</refentrytitle></citerefentry>,
260 <citerefentry><refentrytitle>glCompressedTexSubImage1D
</refentrytitle></citerefentry>,
261 <citerefentry><refentrytitle>glCompressedTexSubImage3D
</refentrytitle></citerefentry>,
262 <citerefentry><refentrytitle>glConvolutionFilter1D
</refentrytitle></citerefentry>,
263 <citerefentry><refentrytitle>glCopyPixels
</refentrytitle></citerefentry>,
264 <citerefentry><refentrytitle>glCopyTexImage1D
</refentrytitle></citerefentry>,
265 <citerefentry><refentrytitle>glCopyTexImage2D
</refentrytitle></citerefentry>,
266 <citerefentry><refentrytitle>glCopyTexSubImage1D
</refentrytitle></citerefentry>,
267 <citerefentry><refentrytitle>glCopyTexSubImage2D
</refentrytitle></citerefentry>,
268 <citerefentry><refentrytitle>glCopyTexSubImage3D
</refentrytitle></citerefentry>,
269 <citerefentry><refentrytitle>glDrawPixels
</refentrytitle></citerefentry>,
270 <citerefentry><refentrytitle>glMatrixMode
</refentrytitle></citerefentry>,
271 <citerefentry><refentrytitle>glPixelStore
</refentrytitle></citerefentry>,
272 <citerefentry><refentrytitle>glPixelTransfer
</refentrytitle></citerefentry>,
273 <citerefentry><refentrytitle>glTexEnv
</refentrytitle></citerefentry>,
274 <citerefentry><refentrytitle>glTexGen
</refentrytitle></citerefentry>,
275 <citerefentry><refentrytitle>glTexImage2D
</refentrytitle></citerefentry>,
276 <citerefentry><refentrytitle>glTexImage3D
</refentrytitle></citerefentry>,
277 <citerefentry><refentrytitle>glTexSubImage1D
</refentrytitle></citerefentry>,
278 <citerefentry><refentrytitle>glTexSubImage2D
</refentrytitle></citerefentry>,
279 <citerefentry><refentrytitle>glTexSubImage3D
</refentrytitle></citerefentry>,
280 <citerefentry><refentrytitle>glTexParameter
</refentrytitle></citerefentry>
283 <refsect1 id=
"Copyright"><title>Copyright
</title>
285 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
286 Silicon Graphics, Inc. This document is licensed under the SGI
287 Free Software B License. For details, see
288 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.