<?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="glNormalPointer">
<refmeta>
<refentrytitle>glNormalPointer</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glNormalPointer</refname>
<refpurpose>define an array of normals</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glNormalPointer</function></funcdef>
<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>type</parameter>
</term>
<listitem>
<para>Specifies the data type of each 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
normals. If <parameter>stride</parameter>
is 0, the normals 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 normal in the array. The initial value is 0.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para><function>glNormalPointer</function>
specifies the location and data of an array of normals to use
when rendering. <parameter>type</parameter>
specifies the data type of the normal coordinates and
<parameter>stride</parameter>
gives the byte stride from one normal 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 normal array is
specified,
<parameter>type</parameter> ,
<parameter>stride</parameter> , and
<parameter>pointer</parameter>
are saved as client-side state.</para>
<para>
If the normal 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 normal array, call
<citerefentry><refentrytitle>glEnableClientState</refentrytitle></citerefentry>
and
<citerefentry><refentrytitle>glDisableClientState</refentrytitle></citerefentry>
with the argument <constant>GL_NORMAL_ARRAY</constant>.
The normal 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>glNormalPointer</function>
is typically implemented on the client side.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para><constant>GL_INVALID_ENUM</constant> is generated if
<parameter>type</parameter> 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>glTexCoordPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glVertexPointer</refentrytitle></citerefentry>
</para>
</refsect1>
</refentry>