Commit | Line | Data |
---|---|---|
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 --> | |
c7b31271 | 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 3.3 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> |
7faf1d71 AW |
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><</mml:mo> | |
c7b31271 | 111 | <mml:mn>0</mml:mn> |
7faf1d71 AW |
112 | </mml:mrow> |
113 | </mml:math>, | |
114 | or if | |
115 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
116 | ||
117 | <mml:mrow> | |
118 | <mml:mfenced open="(" close=")"> | |
119 | <mml:mrow> | |
120 | <mml:mi mathvariant="italic">xoffset</mml:mi> | |
121 | <mml:mo>+</mml:mo> | |
122 | <mml:mi mathvariant="italic">width</mml:mi> | |
123 | </mml:mrow> | |
124 | </mml:mfenced> | |
125 | <mml:mo>></mml:mo> | |
c7b31271 | 126 | <mml:mi mathvariant="italic">w</mml:mi> |
7faf1d71 AW |
127 | </mml:mrow> |
128 | </mml:math>, | |
129 | where | |
130 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math> | |
c7b31271 | 131 | is the <code class="constant">GL_TEXTURE_WIDTH</code> |
7faf1d71 | 132 | of the texture image being modified. |
7faf1d71 AW |
133 | </p><p> |
134 | <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>width</code></em> is less than 0. | |
135 | </p><p> | |
136 | <code class="constant">GL_INVALID_OPERATION</code> is generated if the texture array has not | |
137 | been defined by a previous <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a> operation. | |
138 | </p><p> | |
139 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of | |
140 | <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>, | |
141 | <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>, | |
142 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, or | |
143 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code> | |
144 | and <em class="parameter"><code>format</code></em> is not <code class="constant">GL_RGB</code>. | |
145 | </p><p> | |
146 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of | |
147 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>, | |
148 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>, | |
149 | <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>, | |
150 | <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>, | |
151 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>, | |
152 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>, | |
153 | <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, or | |
154 | <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code> | |
155 | and <em class="parameter"><code>format</code></em> is neither <code class="constant">GL_RGBA</code> nor <code class="constant">GL_BGRA</code>. | |
156 | </p><p> | |
157 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
158 | <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped. | |
159 | </p><p> | |
160 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
161 | <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer | |
162 | object such that the memory reads required would exceed the data store size. | |
163 | </p><p> | |
164 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
165 | <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and <em class="parameter"><code>data</code></em> is not evenly divisible | |
166 | into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>. | |
167 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
168 | <a href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a> | |
169 | </p><p> | |
170 | <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> | |
171 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
172 | <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>, | |
173 | <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>, | |
174 | <a href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>, | |
175 | <a href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>, | |
176 | <a href="glCopyTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>, | |
177 | <a href="glCopyTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage3D</span></span></a>, | |
178 | <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>, | |
179 | <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, | |
180 | <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>, | |
181 | <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>, | |
182 | <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>, | |
183 | <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>, | |
184 | <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a> | |
185 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
186 | Copyright <span class="trademark"></span>© 1991-2006 | |
187 | Silicon Graphics, Inc. This document is licensed under the SGI | |
188 | Free Software B License. For details, see | |
189 | <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
190 | </p></div></div></body></html> |