<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glTexSubImage1D</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="&#xA;      PyOpenGL 2.0.1.04 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glTexParameter.3G.xml" title="glTexParameter"/><link rel="next" href="glTexSubImage2D.3G.xml" title="glTexSubImage2D"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glTexSubImage1D</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glTexParameter.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glTexSubImage2D.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glTexSubImage1D.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glTexSubImage1D.3G-name"/><h2>Name</h2><p>glTexSubImage1D, glTexSubImage1Db, glTexSubImage1Df, glTexSubImage1Di, glTexSubImage1Ds, glTexSubImage1Dub, glTexSubImage1Dui, glTexSubImage1Dus &#8212; specify a one-dimensional texture subimage</p></div><div class="refsynopsisdiv"><a name="glTexSubImage1D.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glTexSubImage1D</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>target</tt></i>
              , GLint <i><tt>level</tt></i>
              , GLint <i><tt>xoffset</tt></i>
              , GLsizei <i><tt>width</tt></i>
              , GLenum <i><tt>format</tt></i>
              , GLenum <i><tt>type</tt></i>
              , const GLvoid *<i><tt>pixels</tt></i>
              );</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glTexSubImage1D.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>
                <tt>glTexSubImage1D</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>target</tt></i>
              , 
                <i><tt>level</tt></i>
              , 
                <i><tt>xoffset</tt></i>
              , 
                <i><tt>width</tt></i>
              , 
                <i><tt>format</tt></i>
              , 
                <i><tt>type</tt></i>
              , 
                <i><tt>pixels</tt></i>
              ) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glTexSubImage1Db</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>target</tt></i>
              , 
                <i><tt>level</tt></i>
              , 
                <i><tt>xoffset</tt></i>
              , 
                <i><tt>format</tt></i>
              , 
                <i><tt>type</tt></i>
              , 
                <i><tt>pixels</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glTexSubImage1Df</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>target</tt></i>
              , 
                <i><tt>level</tt></i>
              , 
                <i><tt>xoffset</tt></i>
              , 
                <i><tt>format</tt></i>
              , 
                <i><tt>type</tt></i>
              , 
                <i><tt>pixels</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glTexSubImage1Di</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>target</tt></i>
              , 
                <i><tt>level</tt></i>
              , 
                <i><tt>xoffset</tt></i>
              , 
                <i><tt>format</tt></i>
              , 
                <i><tt>type</tt></i>
              , 
                <i><tt>pixels</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glTexSubImage1Ds</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>target</tt></i>
              , 
                <i><tt>level</tt></i>
              , 
                <i><tt>xoffset</tt></i>
              , 
                <i><tt>format</tt></i>
              , 
                <i><tt>type</tt></i>
              , 
                <i><tt>pixels</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glTexSubImage1Dub</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>target</tt></i>
              , 
                <i><tt>level</tt></i>
              , 
                <i><tt>xoffset</tt></i>
              , 
                <i><tt>format</tt></i>
              , 
                <i><tt>type</tt></i>
              , 
                <i><tt>pixels</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glTexSubImage1Dui</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>target</tt></i>
              , 
                <i><tt>level</tt></i>
              , 
                <i><tt>xoffset</tt></i>
              , 
                <i><tt>format</tt></i>
              , 
                <i><tt>type</tt></i>
              , 
                <i><tt>pixels</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glTexSubImage1Dus</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>target</tt></i>
              , 
                <i><tt>level</tt></i>
              , 
                <i><tt>xoffset</tt></i>
              , 
                <i><tt>format</tt></i>
              , 
                <i><tt>type</tt></i>
              , 
                <i><tt>pixels</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr></table></div><div class="refsect1" lang="en"><a name="glTexSubImage1D.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term">
                <i><tt>target</tt></i>
              </span></dt><dd>
						Specifies the target texture. Must be <tt>GL_TEXTURE_1D</tt>.
					</dd><dt><span class="term">
                <i><tt>level</tt></i>
              </span></dt><dd>
						Specifies the level-of-detail number. Level 0 is the base image level. Level <span class="emphasis"><em>n</em></span> is the
						<span class="emphasis"><em>n</em></span>th mipmap reduction image.
					</dd><dt><span class="term">
                <i><tt>xoffset</tt></i>
              </span></dt><dd>
						Specifies a texel offset in the x direction within the texture array.
					</dd><dt><span class="term">
                <i><tt>width</tt></i>
              </span></dt><dd>
						Specifies the width of the texture subimage.
					</dd><dt><span class="term">
                <i><tt>format</tt></i>
              </span></dt><dd>
						Specifies the of the pixel data. The following symbolic values are accepted:
						<tt>GL_COLOR_INDEX</tt>, <tt>GL_RED</tt>, <tt>GL_GREEN</tt>,
						<tt>GL_BLUE</tt>, <tt>GL_ALPHA</tt>, <tt>GL_RGB</tt>,
						<tt>GL_BGR</tt>, <tt>GL_RGBA</tt>, <tt>GL_BGRA</tt>,
						<tt>GL_LUMINANCE</tt>, and <tt>GL_LUMINANCE_ALPHA</tt>.
					</dd><dt><span class="term">
                <i><tt>type</tt></i>
              </span></dt><dd>
						Specifies the data type of the pixel data. The following symbolic values are accepted:
						<tt>GL_UNSIGNED_BYTE</tt>, <tt>GL_BYTE</tt>, <tt>GL_BITMAP</tt>,
						<tt>GL_UNSIGNED_SHORT</tt>, <tt>GL_SHORT</tt>,
						<tt>GL_UNSIGNED_INT</tt>, <tt>GL_INT</tt>, <tt>GL_FLOAT</tt>,
						<tt>GL_UNSIGNED_BYTE_3_3_2</tt>, <tt>GL_UNSIGNED_BYTE_2_3_3_REV</tt>,
						<tt>GL_UNSIGNED_SHORT_5_6_5</tt>, <tt>GL_UNSIGNED_SHORT_5_6_5_REV</tt>,
						<tt>GL_UNSIGNED_SHORT_4_4_4_4</tt>, <tt>GL_UNSIGNED_SHORT_4_4_4_4_REV</tt>,
						<tt>GL_UNSIGNED_SHORT_5_5_5_1</tt>, <tt>GL_UNSIGNED_SHORT_1_5_5_5_REV</tt>,
						<tt>GL_UNSIGNED_INT_8_8_8_8</tt>, <tt>GL_UNSIGNED_INT_8_8_8_8_REV</tt>,
						<tt>GL_UNSIGNED_INT_10_10_10_2</tt>, and <tt>GL_UNSIGNED_INT_2_10_10_10_REV</tt>.
					</dd><dt><span class="term">
                <i><tt>pixels</tt></i>
              </span></dt><dd>
						Specifies a pointer to the image data in memory.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glTexSubImage1D.3G-description"/><h2>Description</h2><p>
			Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To
			enable or disable one-dimensional texturing, call <a href="glEnable.3G.xml"><tt>glEnable</tt></a> and <a href="glEnable.3G.xml"><tt>glDisable</tt></a> with argument <tt>GL_TEXTURE_1D</tt>.
		</p><p>
			<tt>glTexSubImage1D</tt> redefines a contiguous subregion of an existing one-dimensional texture image. The
			texels referenced by <i><tt>pixels</tt></i> replace the portion of the existing texture array with x indices
			<i><tt>xoffset</tt></i> and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mi>xoffset</mml:mi>
						<mml:mo>+</mml:mo>
						<mml:mi>width</mml:mi>
						<mml:mo>-</mml:mo>
						<mml:mn>1</mml:mn>
					</mml:mrow>
				</mml:math>,inclusive. This region may not include any texels outside the range of the texture array as it was
			originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no
			effect.
		</p></div><div class="refsect1" lang="en"><a name="glTexSubImage1D.3G-notes"/><h2>Notes</h2><p>
			<tt>glTexSubImage1D</tt> is available only if the GL version is 1.1 or greater.
		</p><p>
			Texturing has no effect in color index mode.
		</p><p>
			<tt>glPixelStore</tt> and <tt>glPixelTransfer</tt>
			modes affect texture images in exactly the way they affect <a href="glDrawPixels.3G.xml"><tt>glDrawPixels</tt></a>.
		</p><p>
			Formats <tt>GL_BGR</tt>, and <tt>GL_BGRA</tt> and types
			<tt>GL_UNSIGNED_BYTE_3_3_2</tt>, <tt>GL_UNSIGNED_BYTE_2_3_3_REV</tt>,
			<tt>GL_UNSIGNED_SHORT_5_6_5</tt>, <tt>GL_UNSIGNED_SHORT_5_6_5_REV</tt>,
			<tt>GL_UNSIGNED_SHORT_4_4_4_4</tt>, <tt>GL_UNSIGNED_SHORT_4_4_4_4_REV</tt>,
			<tt>GL_UNSIGNED_SHORT_5_5_5_1</tt>, <tt>GL_UNSIGNED_SHORT_1_5_5_5_REV</tt>,
			<tt>GL_UNSIGNED_INT_8_8_8_8</tt>, <tt>GL_UNSIGNED_INT_8_8_8_8_REV</tt>,
			<tt>GL_UNSIGNED_INT_10_10_10_2</tt>, and <tt>GL_UNSIGNED_INT_2_10_10_10_REV</tt> are available
			only if the GL version is 1.2 or greater.
		</p><p>
			When the <tt>GL_ARB_multitexture</tt> extension is supported, <tt>glTexSubImage1D</tt>
			specifies a one-dimensional sub texture for the current texture unit, specified with <a href="glActiveTextureARB.3G.xml"><tt>glActiveTextureARB</tt></a>.
		</p><p>
			When the <tt>GL_ARB_imaging</tt> extension is supported, the RGBA components specified in
			<i><tt>pixels</tt></i> may be processed by the imaging pipeline. See <a href="glTexImage1D.3G.xml"><tt>glTexImage1D</tt></a> for specific details.
		</p></div><div class="refsect1" lang="en"><a name="glTexSubImage1D.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>target</tt></i> is not one of the allowable values.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if the texture array has not been defined by a previous
			<a href="glTexImage1D.3G.xml"><tt>glTexImage1D</tt></a> operation.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>level</tt></i> is less than 0.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> may be generated if <i><tt>level</tt></i> is greater than <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:msub>
						<mml:mi>log</mml:mi>
						<mml:mn>2</mml:mn>
					</mml:msub>
				</mml:math>
            <i><tt>max</tt></i>, where <i><tt>max</tt></i> is the returned value of
			<tt>GL_MAX_TEXTURE_SIZE</tt>.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mi>xoffset</mml:mi>
						<mml:mo>&lt;</mml:mo>
						<mml:mo>-b</mml:mo>
					</mml:mrow>
				</mml:math>, or if <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>(</mml:mo>
						<mml:mi>xoffset</mml:mi>
						<mml:mo>+</mml:mo>
						<mml:mi>width</mml:mi>
						<mml:mo>)</mml:mo>
						<mml:mo>&gt;</mml:mo>
						<mml:mo>(</mml:mo>
						<mml:mi>w</mml:mi>
						<mml:mo>-</mml:mo>
						<mml:mi>b</mml:mi>
						<mml:mo>)</mml:mo>
					</mml:mrow>
				</mml:math>, where <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>w</mml:mi>
				</mml:math> is the <tt>GL_TEXTURE_WIDTH</tt>, and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>b</mml:mi>
				</mml:math> is the width of the <tt>GL_TEXTURE_BORDER</tt> of the texture image being modified. Note
			that <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>w</mml:mi>
				</mml:math> includes twice the border width.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>width</tt></i> is less than 0.
		</p><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>format</tt></i> is not an accepted constant.
		</p><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>type</tt></i> is not a type constant.
		</p><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>type</tt></i> is <tt>GL_BITMAP</tt> and
			<i><tt>format</tt></i> is not <tt>GL_COLOR_INDEX</tt>.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glTexSubImage1D</tt> is executed between the
			execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of <a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <i><tt>type</tt></i> is one of
			<tt>GL_UNSIGNED_BYTE_3_3_2</tt>, <tt>GL_UNSIGNED_BYTE_2_3_3_REV</tt>,
			<tt>GL_UNSIGNED_SHORT_5_6_5</tt>, or <tt>GL_UNSIGNED_SHORT_5_6_5_REV</tt> and
			<i><tt>format</tt></i> is not <tt>GL_RGB</tt>.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <i><tt>type</tt></i> is one of
			<tt>GL_UNSIGNED_SHORT_4_4_4_4</tt>, <tt>GL_UNSIGNED_SHORT_4_4_4_4_REV</tt>,
			<tt>GL_UNSIGNED_SHORT_5_5_5_1</tt>, <tt>GL_UNSIGNED_SHORT_1_5_5_5_REV</tt>,
			<tt>GL_UNSIGNED_INT_8_8_8_8</tt>, <tt>GL_UNSIGNED_INT_8_8_8_8_REV</tt>,
			<tt>GL_UNSIGNED_INT_10_10_10_2</tt>, or <tt>GL_UNSIGNED_INT_2_10_10_10_REV</tt> and
			<i><tt>format</tt></i> is neither <tt>GL_RGBA</tt> nor <tt>GL_BGRA</tt>.
		</p></div><div class="refsect1" lang="en"><a name="glTexSubImage1D.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<a href="glGetTexImage.3G.xml"><tt>glGetTexImage</tt></a>
		</p><p>
			<a href="glIsEnabled.3G.xml"><tt>glIsEnabled</tt></a> with argument <tt>GL_TEXTURE_1D</tt>
		</p></div><div class="refsect1" lang="en"><a name="glTexSubImage1D.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist">
                <a href="glActiveTextureARB.3G.xml">glActiveTextureARB</a>
              , 
                <a href="glCopyTexImage1D.3G.xml">glCopyTexImage1D</a>
              , 
                <a href="glCopyTexImage2D.3G.xml">glCopyTexImage2D</a>
              , 
                <a href="glCopyTexSubImage1D.3G.xml">glCopyTexSubImage1D</a>
              , 
                <a href="glCopyTexSubImage2D.3G.xml">glCopyTexSubImage2D</a>
              , 
                <a href="glCopyTexSubImage3D.3G.xml">glCopyTexSubImage3D</a>
              , 
                <a href="glDrawPixels.3G.xml">glDrawPixels</a>
              , 
                <a href="glPixelStore.3G.xml">glPixelStore</a>
              , 
                <a href="glPixelTransfer.3G.xml">glPixelTransfer</a>
              , 
                <a href="glTexEnv.3G.xml">glTexEnv</a>
              , 
                <a href="glTexGen.3G.xml">glTexGen</a>
              , 
                <a href="glTexImage1D.3G.xml">glTexImage1D</a>
              , 
                <a href="glTexImage2D.3G.xml">glTexImage2D</a>
              , 
                <a href="glTexImage3D.3G.xml">glTexImage3D</a>
              , 
                <a href="glTexParameter.3G.xml">glTexParameter</a>
              , 
                <a href="glTexSubImage2D.3G.xml">glTexSubImage2D</a>
              , 
                <a href="glTexSubImage3D.3G.xml">glTexSubImage3D</a>
              </span>
		</p></div><div class="refsect1" lang="en"><a name="glTexSubImage1D.3G-python_samples"/><h2>Python Sample Code</h2><p>
            </p><div class="variablelist"><dl><dt><span class="term">glTexSubImage1D</span></dt><dd><div class="itemizedlist"><ul type="disc"><li>{LGPL} VisionEgg/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/visionegg/visionegg/src/Gratings.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">src/Gratings.py</a> Ln#294 </li><li>{LGPL} VisionEgg/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/visionegg/visionegg/src/SphereMap.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">src/SphereMap.py</a> Ln#384 </li><li>{LGPL} VisionEgg/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/visionegg/visionegg/src/Textures.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">src/Textures.py</a> Ln#807 </li></ul></div></dd><dt><span class="term">GL_TEXTURE_1D</span></dt><dd><div class="itemizedlist"><ul type="disc"><li>{LGPL} VisionEgg/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/visionegg/visionegg/src/Gratings.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">src/Gratings.py</a> Ln#294 </li><li>{LGPL} VisionEgg/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/visionegg/visionegg/src/SphereMap.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">src/SphereMap.py</a> Ln#384 </li><li>{LGPL} VisionEgg/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/visionegg/visionegg/src/Textures.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">src/Textures.py</a> Ln#807 </li></ul></div></dd></dl></div><p>
          </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glTexParameter.3G.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="glTexSubImage2D.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glTexParameter </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glTexSubImage2D</td></tr></table></div></body></html>