1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glNormalPointer">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glNormalPointer
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glNormalPointer
</refname>
17 <refpurpose>define an array of normals
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glNormalPointer
</function></funcdef>
23 <paramdef>GLenum
<parameter>type
</parameter></paramdef>
24 <paramdef>GLsizei
<parameter>stride
</parameter></paramdef>
25 <paramdef>const GLvoid *
<parameter>pointer
</parameter></paramdef>
29 <!-- eqn: ignoring delim $$ -->
30 <refsect1 id=
"parameters"><title>Parameters
</title>
33 <term><parameter>type
</parameter></term>
36 Specifies the data type of each coordinate in the array.
38 <constant>GL_BYTE
</constant>,
39 <constant>GL_SHORT
</constant>,
40 <constant>GL_INT
</constant>,
41 <constant>GL_FLOAT
</constant>, and
42 <constant>GL_DOUBLE
</constant>
43 are accepted. The initial value is
<constant>GL_FLOAT
</constant>.
48 <term><parameter>stride
</parameter></term>
51 Specifies the byte offset between consecutive normals. If
<parameter>stride
</parameter> is
52 0, the normals are understood to be tightly packed in
53 the array. The initial value is
0.
58 <term><parameter>pointer
</parameter></term>
61 Specifies a pointer to the first coordinate of the first normal in the
62 array. The initial value is
0.
68 <refsect1 id=
"description"><title>Description
</title>
70 <function>glNormalPointer
</function> specifies the location and data format of an array of normals
71 to use when rendering.
72 <parameter>type
</parameter> specifies the data type of each normal coordinate,
73 and
<parameter>stride
</parameter> specifies the byte stride from one
74 normal to the next, allowing vertices and attributes
75 to be packed into a single array or stored in separate arrays.
76 (Single-array storage may be more efficient on some implementations;
77 see
<citerefentry><refentrytitle>glInterleavedArrays
</refentrytitle></citerefentry>.)
80 If a non-zero named buffer object is bound to the
<constant>GL_ARRAY_BUFFER
</constant> target
81 (see
<citerefentry><refentrytitle>glBindBuffer
</refentrytitle></citerefentry>) while a normal array is
82 specified,
<parameter>pointer
</parameter> is treated as a byte offset into the buffer object's data store.
83 Also, the buffer object binding (
<constant>GL_ARRAY_BUFFER_BINDING
</constant>) is saved as normal vertex array
84 client-side state (
<constant>GL_NORMAL_ARRAY_BUFFER_BINDING
</constant>).
87 When a normal array is specified,
88 <parameter>type
</parameter>,
<parameter>stride
</parameter>, and
<parameter>pointer
</parameter> are saved as client-side
89 state, in addition to the current vertex array buffer object binding.
92 To enable and disable the normal array, call
93 <citerefentry><refentrytitle>glEnableClientState
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glDisableClientState
</refentrytitle></citerefentry> with the argument
94 <constant>GL_NORMAL_ARRAY
</constant>. If
95 enabled, the normal array is used
96 when
<citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
97 <citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>, or
98 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry> is called.
101 <refsect1 id=
"notes"><title>Notes
</title>
103 <function>glNormalPointer
</function> is available only if the GL version is
1.1 or greater.
106 The normal array is initially disabled and isn't accessed when
107 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>,
108 <citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>, or
<citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>
112 Execution of
<function>glNormalPointer
</function> is not allowed between
113 <citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry> and the corresponding
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>,
114 but an error may or may not be generated. If an error is not generated,
115 the operation is undefined.
118 <function>glNormalPointer
</function> is typically implemented on the client side.
121 Normal array parameters are client-side state and are therefore not
122 saved or restored by
<citerefentry><refentrytitle>glPushAttrib
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glPopAttrib
</refentrytitle></citerefentry>.
123 Use
<citerefentry><refentrytitle>glPushClientAttrib
</refentrytitle></citerefentry> and
124 <citerefentry><refentrytitle>glPopClientAttrib
</refentrytitle></citerefentry> instead.
127 <refsect1 id=
"errors"><title>Errors
</title>
129 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>type
</parameter> is not an accepted value.
132 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>stride
</parameter> is negative.
135 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
137 <citerefentry><refentrytitle>glIsEnabled
</refentrytitle></citerefentry> with argument
<constant>GL_NORMAL_ARRAY
</constant>
140 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_NORMAL_ARRAY_TYPE
</constant>
143 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_NORMAL_ARRAY_STRIDE
</constant>
146 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_NORMAL_ARRAY_BUFFER_BINDING
</constant>
149 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_ARRAY_BUFFER_BINDING
</constant>
152 <citerefentry><refentrytitle>glGetPointerv
</refentrytitle></citerefentry> with argument
<constant>GL_NORMAL_ARRAY_POINTER
</constant>
155 <refsect1 id=
"seealso"><title>See Also
</title>
157 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry>,
158 <citerefentry><refentrytitle>glBindBuffer
</refentrytitle></citerefentry>,
159 <citerefentry><refentrytitle>glColorPointer
</refentrytitle></citerefentry>,
160 <citerefentry><refentrytitle>glDisableClientState
</refentrytitle></citerefentry>,
161 <citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
162 <citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
163 <citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>,
164 <citerefentry><refentrytitle>glEdgeFlagPointer
</refentrytitle></citerefentry>,
165 <citerefentry><refentrytitle>glEnableClientState
</refentrytitle></citerefentry>,
166 <citerefentry><refentrytitle>glFogCoordPointer
</refentrytitle></citerefentry>,
167 <citerefentry><refentrytitle>glIndexPointer
</refentrytitle></citerefentry>,
168 <citerefentry><refentrytitle>glInterleavedArrays
</refentrytitle></citerefentry>,
169 <citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>,
170 <citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>,
171 <citerefentry><refentrytitle>glNormal
</refentrytitle></citerefentry>,
172 <citerefentry><refentrytitle>glPopClientAttrib
</refentrytitle></citerefentry>,
173 <citerefentry><refentrytitle>glPushClientAttrib
</refentrytitle></citerefentry>,
174 <citerefentry><refentrytitle>glSecondaryColorPointer
</refentrytitle></citerefentry>,
175 <citerefentry><refentrytitle>glTexCoordPointer
</refentrytitle></citerefentry>,
176 <citerefentry><refentrytitle>glVertexAttribPointer
</refentrytitle></citerefentry>,
177 <citerefentry><refentrytitle>glVertexPointer
</refentrytitle></citerefentry>
180 <refsect1 id=
"Copyright"><title>Copyright
</title>
182 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
183 Silicon Graphics, Inc. This document is licensed under the SGI
184 Free Software B License. For details, see
185 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.