<?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>glVertexPointer</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="glVertex.3G.xml" title="glVertex"/><link rel="next" href="glViewport.3G.xml" title="glViewport"/></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">glVertexPointer</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glVertex.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glViewport.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glVertexPointer.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glVertexPointer.3G-name"/><h2>Name</h2><p>glVertexPointer, glVertexPointerb, glVertexPointerd, glVertexPointerf, glVertexPointeri, glVertexPointers &#8212; define an array of vertex data</p></div><div class="refsynopsisdiv"><a name="glVertexPointer.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glVertexPointer</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLint <i><tt>size</tt></i>
              , GLenum <i><tt>type</tt></i>
              , GLsizei <i><tt>stride</tt></i>
              , const GLvoid *<i><tt>pointer</tt></i>
              );</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glVertexPointer.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>
                <tt>glVertexPointer</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>size</tt></i>
              , 
                <i><tt>type</tt></i>
              , 
                <i><tt>stride</tt></i>
              , 
                <i><tt>pointer</tt></i>
              ) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glVertexPointerb</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>pointer</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glVertexPointerd</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>pointer</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glVertexPointerf</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>pointer</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glVertexPointeri</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>pointer</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr><tr><td valign="top"><code>
                <tt>glVertexPointers</tt>
              </code></td><td valign="top"><code>(</code></td><td valign="top"><code>
                <i><tt>pointer</tt></i>[][]) &#8594; 
                <tt>None</tt>
              </code></td></tr></table></div><div class="refsect1" lang="en"><a name="glVertexPointer.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term">
                <i><tt>size</tt></i>
              </span></dt><dd>
						Specifies the number of coordinates per vertex; must be 2, 3, or 4. The initial value is 4.
					</dd><dt><span class="term">
                <i><tt>type</tt></i>
              </span></dt><dd>
						Specifies the data type of each coordinate in the array. Symbolic constants <tt>GL_SHORT</tt>,
						<tt>GL_INT</tt>, <tt>GL_FLOAT</tt>, and <tt>GL_DOUBLE</tt> are
						accepted. The initial value is <tt>GL_FLOAT</tt>.
					</dd><dt><span class="term">
                <i><tt>stride</tt></i>
              </span></dt><dd>
						Specifies the byte offset between consecutive vertexes. If <i><tt>stride</tt></i> is 0, the vertexes
						are understood to be tightly packed in the array. The initial value is 0.
					</dd><dt><span class="term">
                <i><tt>pointer</tt></i>
              </span></dt><dd>
						Specifies a pointer to the first coordinate of the first vertex in the array. The initial value is 0.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glVertexPointer.3G-description"/><h2>Description</h2><p>
			<tt>glVertexPointer</tt> specifies the location and data of an array of vertex coordinates to use when
			rendering. <i><tt>size</tt></i> specifies the number of coordinates per vertex and <i><tt>type</tt></i>
			the data type of the coordinates. <i><tt>stride</tt></i> specifies the byte stride from one vertex to the next
			allowing vertexes and attributes to be packed into a single array or stored in separate arrays. (Single-array storage
			may be more efficient on some implementations; see <a href="glInterleavedArrays.3G.xml">glInterleavedArrays</a>.) When a vertex array is specified, <i><tt>size</tt></i>, <i><tt>type</tt></i>,
			<i><tt>stride</tt></i>, and <i><tt>pointer</tt></i> are saved as client-side state.
		</p><p>
			To enable and disable the vertex array, call <a href="glEnableClientState.3G.xml"><tt>glEnableClientState</tt></a> and
		</p><p>
			<a href="glEnableClientState.3G.xml"><tt>glDisableClientState</tt></a> with the argument <tt>GL_VERTEX_ARRAY</tt>.
			If enabled, the vertex array is used when <a href="glDrawArrays.3G.xml"><tt>glDrawArrays</tt></a>, <a href="glDrawElements.3G.xml"><tt>glDrawElements</tt></a>, or <a href="glArrayElement.3G.xml"><tt>glArrayElement</tt></a> is called.
		</p><p>
			Use <a href="glDrawArrays.3G.xml"><tt>glDrawArrays</tt></a> to construct a sequence of primitives (all of the same type)
			from prespecified vertex and vertex attribute arrays. Use <a href="glArrayElement.3G.xml"><tt>glArrayElement</tt></a> to
			specify primitives by indexing vertexes and vertex attributes and <a href="glDrawElements.3G.xml"><tt>glDrawElements</tt></a> to construct a sequence of primitives by indexing vertexes and vertex
			attributes.
		</p></div><div class="refsect1" lang="en"><a name="glVertexPointer.3G-notes"/><h2>Notes</h2><p>
			<tt>glVertexPointer</tt> is available only if the GL version is 1.1 or greater.
		</p><p>
			The vertex array is initially disabled and isn't accessed when <a href="glArrayElement.3G.xml"><tt>glArrayElement</tt></a>,
			<a href="glDrawElements.3G.xml"><tt>glDrawElements</tt></a> or <a href="glDrawArrays.3G.xml"><tt>glDrawArrays</tt></a> is
			called.
		</p><p>
			Execution of <tt>glVertexPointer</tt> is not allowed 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>, but an error may or may not be generated. If no error is generated, the operation
			is undefined.
		</p><p>
			<tt>glVertexPointer</tt> is typically implemented on the client side.
		</p><p>
			Vertex array parameters are client-side state and are therefore not saved or restored by <a href="glPushAttrib.3G.xml"><tt>glPushAttrib</tt></a> and <a href="glPushAttrib.3G.xml"><tt>glPopAttrib</tt></a>. Use <a href="glPushClientAttrib.3G.xml"><tt>glPushClientAttrib</tt></a> and <a href="glPushClientAttrib.3G.xml"><tt>glPopClientAttrib</tt></a>
			instead.
		</p></div><div class="refsect1" lang="en"><a name="glVertexPointer.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>size</tt></i> is not 2, 3, or 4.
		</p><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>type</tt></i> is is not an accepted value.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>stride</tt></i> is negative.
		</p></div><div class="refsect1" lang="en"><a name="glVertexPointer.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<a href="glIsEnabled.3G.xml"><tt>glIsEnabled</tt></a> with argument <tt>GL_VERTEX_ARRAY</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_VERTEX_ARRAY_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_VERTEX_ARRAY_TYPE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_VERTEX_ARRAY_STRIDE</tt>
		</p><p>
			<a href="glGetPointerv.3G.xml"><tt>glGetPointerv</tt></a> with argument <tt>GL_VERTEX_ARRAY_POINTER</tt>
		</p></div><div class="refsect1" lang="en"><a name="glVertexPointer.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist">
                <a href="glArrayElement.3G.xml">glArrayElement</a>
              , 
                <a href="glColorPointer.3G.xml">glColorPointer</a>
              , 
                <a href="glDrawArrays.3G.xml">glDrawArrays</a>
              , 
                <a href="glDrawElements.3G.xml">glDrawElements</a>
              , 
                <a href="glDrawRangeElements.3G.xml">glDrawRangeElements</a>
              , 
                <a href="glEdgeFlagPointer.3G.xml">glEdgeFlagPointer</a>
              , 
                <a href="glEnable.3G.xml">glEnable</a>
              , 
                <a href="glGetPointerv.3G.xml">glGetPointerv</a>
              , 
                <a href="glIndexPointer.3G.xml">glIndexPointer</a>
              , 
                <a href="glInterleavedArrays.3G.xml">glInterleavedArrays</a>
              , 
                <a href="glNormalPointer.3G.xml">glNormalPointer</a>
              , 
                <a href="glPopClientAttrib.3G.xml">glPopClientAttrib</a>
              , 
                <a href="glPushClientAttrib.3G.xml">glPushClientAttrib</a>
              , 
                <a href="glTexCoordPointer.3G.xml">glTexCoordPointer</a>
              </span>
		</p></div><div class="refsect1" lang="en"><a name="glVertexPointer.3G-python_samples"/><h2>Python Sample Code</h2><p>
            </p><div class="variablelist"><dl><dt><span class="term">glVertexPointer</span></dt><dd><div class="itemizedlist"><ul type="disc"><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/tests/gldrawarrays_string.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">tests/gldrawarrays_string.py</a> Ln#13 </li><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/tests/gldrawelements_base.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">tests/gldrawelements_base.py</a> Ln#19 </li></ul></div></dd><dt><span class="term">glVertexPointerd</span></dt><dd><div class="itemizedlist"><ul type="disc"><li>OpenGL/Demo/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/PyOpenGL2/OpenGL/Demo/da/dots.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">da/dots.py</a> Ln#54 </li><li>OpenGL/Demo/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/PyOpenGL2/OpenGL/Demo/suite/items/da/dots.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">suite/items/da/dots.py</a> Ln#55 </li><li>OpenGL/Demo/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/PyOpenGL2/OpenGL/Demo/tom/arraytest.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">tom/arraytest.py</a> Ln#53 </li><li>OpenGL/Demo/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/PyOpenGL2/OpenGL/Demo/tom/poly.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">tom/poly.py</a> Ln#47 </li><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/scenegraph/arraygeometry.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">scenegraph/arraygeometry.py</a> Ln#114 </li><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/scenegraph/indexedpolygons.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">scenegraph/indexedpolygons.py</a> Ln#157 </li><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/scenegraph/pointset.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">scenegraph/pointset.py</a> Ln#35 </li><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/scenegraph/spherebackground.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">scenegraph/spherebackground.py</a> Ln#32 </li><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/shadow/volume.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">shadow/volume.py</a> Ln#280,292,302 </li><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/tests/glarrayelement.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">tests/glarrayelement.py</a> Ln#16 </li><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/tests/gldrawarrays.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">tests/gldrawarrays.py</a> Ln#15 </li><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/tests/gldrawelements.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">tests/gldrawelements.py</a> Ln#16 </li><li>SciPy/kiva/<a href="http://scipy.net/cgi-bin/viewcvsx.cgi/kiva/glcore2d.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">glcore2d.py</a> Ln#305,326 </li></ul></div></dd><dt><span class="term">GL_DOUBLE</span></dt><dd><div class="itemizedlist"><ul type="disc"><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/tests/gldrawarrays_string.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">tests/gldrawarrays_string.py</a> Ln#13 </li></ul></div></dd><dt><span class="term">GL_FLOAT</span></dt><dd><div class="itemizedlist"><ul type="disc"><li>OpenGLContext/<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyopengl/OpenGLContext/tests/gldrawelements_base.py?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup" target="_top">tests/gldrawelements_base.py</a> Ln#19 </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="glVertex.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="glViewport.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glVertex </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glViewport</td></tr></table></div></body></html>