<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.2//EN" "DTD/docbook/docbookx.dtd">
<!--
License Applicability. Except to the extent portions of this file are
made subject to an alternative license as permitted in the SGI Free
Software License B, Version 1.1 (the "License"), the contents of this
file are subject only to the provisions of the License. You may not use
this file except in compliance with the License. You may obtain a copy
of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
http://oss.sgi.com/projects/FreeB
Note that, as provided in the License, the Software is distributed on an
"AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
Original Code. The Original Code is: OpenGL ES Reference Manual,
Version 1.0, released September 2003, developed by Silicon Graphics,
Inc. The Original Code is Copyright (c) 2003 Silicon Graphics, Inc.
Copyright in any portions created by third parties is as indicated
elsewhere herein. All Rights Reserved.
-->
<refentry id="glVertexPointer">
<refmeta>
<refentrytitle>glVertexPointer</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glVertexPointer</refname>
<refpurpose>define an array of vertex coordinates</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glVertexPointer</function></funcdef>
<paramdef>GLint <parameter>size</parameter></paramdef>
<paramdef>GLenum <parameter>type</parameter></paramdef>
<paramdef>GLsizei <parameter>stride</parameter></paramdef>
<paramdef>const GLvoid * <parameter>pointer</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term>
<parameter>size</parameter>
</term>
<listitem>
<para>Specifies the number of coordinates per vertex.
Must be 2, 3, or 4. The initial value is 4.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>type</parameter>
</term>
<listitem>
<para>Specifies the data type of each vertex coordinate in the
array. Symbolic constants
<constant>GL_BYTE</constant>,
<constant>GL_SHORT</constant>, and
<constant>GL_FIXED</constant>, are accepted.
However, the initial value is
<constant>GL_FLOAT</constant>.</para>
<para>
The common profile accepts the symbolic constant
<constant>GL_FLOAT</constant> as well.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>stride</parameter>
</term>
<listitem>
<para>Specifies the byte offset between consecutive
vertices. If <parameter>stride</parameter>
is 0, the vertices are understood to be tightly packed in
the array. The initial value is 0.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>pointer</parameter>
</term>
<listitem>
<para>Specifies a pointer to the first coordinate of the
first vertex in the array. The initial value is 0.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
<function>glVertexPointer</function>
specifies the location and data of an array of vertex
coordinates to use when rendering. <parameter>size</parameter>
specifies the number of coordinates per vertex and
<parameter>type</parameter> the data type of the coordinates.
<parameter>stride</parameter>
specifies the byte stride from one vertex to the next allowing
vertices and attributes to be packed into a single array or
stored in separate arrays. (Single-array storage may be more
efficient on some implementations.) When a vertex array is
specified,
<parameter>size</parameter>,
<parameter>type</parameter>,
<parameter>stride</parameter>, and
<parameter>pointer</parameter> are saved as client-side state.</para>
<para>If the vertex array is enabled, it is used when
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
or
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>
is called.
To enable and disable the vertex array, call
<citerefentry><refentrytitle>glEnableClientState</refentrytitle></citerefentry>
and
<citerefentry><refentrytitle>glDisableClientState</refentrytitle></citerefentry>
with the argument
<constant>GL_VERTEX_ARRAY</constant>.
The vertex array is initially disabled and isn't accessed when
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry> or
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>
is called.</para>
<para>Use
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>
to construct a sequence of primitives (all of the same type)
from prespecified vertex and vertex attribute arrays. Use
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>
to construct a sequence of primitives by indexing vertices and
vertex attributes.</para>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
<function>glVertexPointer</function>
is typically implemented on the client side.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>size</parameter> is not 2, 3, or 4.</para>
<para><constant>GL_INVALID_ENUM</constant> is generated if
<parameter>type</parameter> is is not an accepted value.</para>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>stride</parameter> is negative.</para>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>glColorPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glNormalPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexCoordPointer</refentrytitle></citerefentry>
</para>
</refsect1>
</refentry>