rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man4 / xhtml / glTexSubImage1D.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>glTexSubImage1D - 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="glTexSubImage1D"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glTexSubImage1D — specify a one-dimensional texture subimage</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">glTexSubImage1D</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">xoffset</var>, </td></tr><tr><td> </td><td>GLsizei  </td><td><var class="pdparam">width</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_1D</code>.
8 </p></dd><dt><span class="term"><em class="parameter"><code>level</code></em></span></dt><dd><p>
9 Specifies the level-of-detail number.
10 Level 0 is the base image level.
11 Level <span class="emphasis"><em>n</em></span> is the <span class="emphasis"><em>n</em></span>th mipmap reduction image.
12 </p></dd><dt><span class="term"><em class="parameter"><code>xoffset</code></em></span></dt><dd><p>
13 Specifies a texel offset in the x direction within the texture array.
14 </p></dd><dt><span class="term"><em class="parameter"><code>width</code></em></span></dt><dd><p>
15 Specifies the width of the texture subimage.
16 </p></dd><dt><span class="term"><em class="parameter"><code>format</code></em></span></dt><dd><p>
17 Specifies the format of the pixel data.
18 The following symbolic values are accepted:
19 <code class="constant">GL_RED</code>,
20 <code class="constant">GL_RG</code>,
21 <code class="constant">GL_RGB</code>,
22 <code class="constant">GL_BGR</code>,
23 <code class="constant">GL_RGBA</code>, and
24 <code class="constant">GL_BGRA</code>.
25 </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p>
26 Specifies the data type of the pixel data.
27 The following symbolic values are accepted:
28 <code class="constant">GL_UNSIGNED_BYTE</code>,
29 <code class="constant">GL_BYTE</code>,
30 <code class="constant">GL_UNSIGNED_SHORT</code>,
31 <code class="constant">GL_SHORT</code>,
32 <code class="constant">GL_UNSIGNED_INT</code>,
33 <code class="constant">GL_INT</code>,
34 <code class="constant">GL_FLOAT</code>,
35 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
36 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
37 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>,
38 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>,
39 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
40 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
41 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
42 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
43 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
44 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
45 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, and
46 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>.
47 </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p>
48 Specifies a pointer to the image data in memory.
49 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
50 Texturing maps a portion of a specified texture image
51 onto each graphical primitive for which texturing is enabled.
52 To enable or disable one-dimensional texturing, call <a href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>
53 and <a href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a> with argument <code class="constant">GL_TEXTURE_1D</code>.
54 </p><p>
55 <code class="function">glTexSubImage1D</code> redefines a contiguous subregion of an existing one-dimensional
56 texture image.
57 The texels referenced by <em class="parameter"><code>data</code></em> replace the portion of the
58 existing texture array with x indices <em class="parameter"><code>xoffset</code></em> and
59 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
60
61 <mml:mrow>
62 <mml:mi mathvariant="italic">xoffset</mml:mi>
63 <mml:mo>+</mml:mo>
64 <mml:mi mathvariant="italic">width</mml:mi>
65 <mml:mo>-</mml:mo>
66 <mml:mn>1</mml:mn>
67 </mml:mrow>
68 </mml:math>,
69 inclusive.
70 This region may not include any texels outside the range of the
71 texture array as it was originally specified.
72 It is not an error to specify a subtexture with width of 0, but
73 such a specification has no effect.
74 </p><p>
75 If a non-zero named buffer object is bound to the <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target
76 (see <a href="glBindBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>) while a texture image is
77 specified, <em class="parameter"><code>data</code></em> is treated as a byte offset into the buffer object's data store.
78 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
79 <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> modes affect texture images.
80 </p><p>
81 <code class="function">glTexSubImage1D</code> specifies a one-dimensional subtexture for the current texture unit,
82 specified with <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>.
83 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
84 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not one of the
85 allowable values.
86 </p><p>
87 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>format</code></em> is not an accepted
88 format constant.
89 </p><p>
90 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not a type constant.
91 </p><p>
92 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0.
93 </p><p>
94 <code class="constant">GL_INVALID_VALUE</code> may be generated if <em class="parameter"><code>level</code></em> is greater
95 than
96 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
97
98 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
99 <mml:mn>2</mml:mn>
100 </mml:msub>
101 </mml:math>
102 <span class="emphasis"><em>max</em></span>,
103 where <span class="emphasis"><em>max</em></span> is the returned value of <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
104 </p><p>
105 <code class="constant">GL_INVALID_VALUE</code> is generated if
106 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
107
108 <mml:mrow>
109 <mml:mi mathvariant="italic">xoffset</mml:mi>
110 <mml:mo>&lt;</mml:mo>
111 <mml:mrow>
112 <mml:mo>-</mml:mo>
113 <mml:mi mathvariant="italic">b</mml:mi>
114 </mml:mrow>
115 </mml:mrow>
116 </mml:math>,
117 or if
118 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
119
120 <mml:mrow>
121 <mml:mfenced open="(" close=")">
122 <mml:mrow>
123 <mml:mi mathvariant="italic">xoffset</mml:mi>
124 <mml:mo>+</mml:mo>
125 <mml:mi mathvariant="italic">width</mml:mi>
126 </mml:mrow>
127 </mml:mfenced>
128 <mml:mo>&gt;</mml:mo>
129 <mml:mfenced open="(" close=")">
130 <mml:mrow>
131 <mml:mi mathvariant="italic">w</mml:mi>
132 <mml:mo>-</mml:mo>
133 <mml:mi mathvariant="italic">b</mml:mi>
134 </mml:mrow>
135 </mml:mfenced>
136 </mml:mrow>
137 </mml:math>,
138 where
139 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math>
140 is the <code class="constant">GL_TEXTURE_WIDTH</code>, and
141 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">b</mml:mi></mml:math>
142 is
143 the width of the <code class="constant">GL_TEXTURE_BORDER</code>
144 of the texture image being modified.
145 Note that
146 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math>
147 includes twice the border width.
148 </p><p>
149 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>width</code></em> is less than 0.
150 </p><p>
151 <code class="constant">GL_INVALID_OPERATION</code> is generated if the texture array has not
152 been defined by a previous <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a> operation.
153 </p><p>
154 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
155 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
156 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
157 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, or
158 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>
159 and <em class="parameter"><code>format</code></em> is not <code class="constant">GL_RGB</code>.
160 </p><p>
161 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
162 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
163 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
164 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
165 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
166 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
167 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
168 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, or
169 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>
170 and <em class="parameter"><code>format</code></em> is neither <code class="constant">GL_RGBA</code> nor <code class="constant">GL_BGRA</code>.
171 </p><p>
172 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
173 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped.
174 </p><p>
175 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
176 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer
177 object such that the memory reads required would exceed the data store size.
178 </p><p>
179 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
180 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and <em class="parameter"><code>data</code></em> is not evenly divisible
181 into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>.
182 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
183 <a href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a>
184 </p><p>
185 <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>
186 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
187 <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>,
188 <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>,
189 <a href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>,
190 <a href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>,
191 <a href="glCopyTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>,
192 <a href="glCopyTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage3D</span></span></a>,
193 <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>,
194 <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>,
195 <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>,
196 <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>,
197 <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>,
198 <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>,
199 <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>
200 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
201 Copyright <span class="trademark"></span>© 1991-2006
202 Silicon Graphics, Inc. This document is licensed under the SGI
203 Free Software B License. For details, see
204 <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
205 </p></div></div></body></html>