Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1452 chris 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">
5
    <refmeta>
6
        <refmetainfo>
7
            <copyright>
8
                <year>1991-2006</year>
9
                <holder>Silicon Graphics, Inc.</holder>
10
            </copyright>
11
        </refmetainfo>
12
        <refentrytitle>glNormalPointer</refentrytitle>
13
        <manvolnum>3G</manvolnum>
14
    </refmeta>
15
    <refnamediv>
16
        <refname>glNormalPointer</refname>
17
        <refpurpose>define an array of normals</refpurpose>
18
    </refnamediv>
19
    <refsynopsisdiv><title>C Specification</title>
20
        <funcsynopsis>
21
            <funcprototype>
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>
26
            </funcprototype>
27
        </funcsynopsis>
28
    </refsynopsisdiv>
29
    <!-- eqn: ignoring delim $$ -->
30
    <refsect1 id="parameters"><title>Parameters</title>
31
        <variablelist>
32
        <varlistentry>
33
            <term><parameter>type</parameter></term>
34
            <listitem>
35
                <para>
36
                    Specifies the data type of each coordinate in the array.
37
                    Symbolic constants
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>.
44
                </para>
45
            </listitem>
46
        </varlistentry>
47
        <varlistentry>
48
            <term><parameter>stride</parameter></term>
49
            <listitem>
50
                <para>
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.
54
                </para>
55
            </listitem>
56
        </varlistentry>
57
        <varlistentry>
58
            <term><parameter>pointer</parameter></term>
59
            <listitem>
60
                <para>
61
                    Specifies a pointer to the first coordinate of the first normal in the
62
                    array. The initial value is 0.
63
                </para>
64
            </listitem>
65
        </varlistentry>
66
        </variablelist>
67
    </refsect1>
68
    <refsect1 id="description"><title>Description</title>
69
        <para>
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>.)
78
        </para>
79
        <para>
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>).
85
        </para>
86
        <para>
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.
90
        </para>
91
        <para>
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.
99
        </para>
100
    </refsect1>
101
    <refsect1 id="notes"><title>Notes</title>
102
        <para>
103
            <function>glNormalPointer</function> is available only if the GL version is 1.1 or greater.
104
        </para>
105
        <para>
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>
109
            is called.
110
        </para>
111
        <para>
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.
116
        </para>
117
        <para>
118
            <function>glNormalPointer</function> is typically implemented on the client side.
119
        </para>
120
        <para>
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.
125
        </para>
126
    </refsect1>
127
    <refsect1 id="errors"><title>Errors</title>
128
        <para>
129
            <constant>GL_INVALID_ENUM</constant> is generated if <parameter>type</parameter> is not an accepted value.
130
        </para>
131
        <para>
132
            <constant>GL_INVALID_VALUE</constant> is generated if <parameter>stride</parameter> is negative.
133
        </para>
134
    </refsect1>
135
    <refsect1 id="associatedgets"><title>Associated Gets</title>
136
        <para>
137
            <citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_NORMAL_ARRAY</constant>
138
        </para>
139
        <para>
140
            <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_NORMAL_ARRAY_TYPE</constant>
141
        </para>
142
        <para>
143
            <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_NORMAL_ARRAY_STRIDE</constant>
144
        </para>
145
        <para>
146
            <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_NORMAL_ARRAY_BUFFER_BINDING</constant>
147
        </para>
148
        <para>
149
            <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_ARRAY_BUFFER_BINDING</constant>
150
        </para>
151
        <para>
152
            <citerefentry><refentrytitle>glGetPointerv</refentrytitle></citerefentry> with argument <constant>GL_NORMAL_ARRAY_POINTER</constant>
153
        </para>
154
    </refsect1>
155
    <refsect1 id="seealso"><title>See Also</title>
156
        <para>
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>
178
        </para>
179
    </refsect1>
180
    <refsect1 id="Copyright"><title>Copyright</title>
181
        <para>
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>.
186
        </para>
187
    </refsect1>
188
</refentry>