0e557b298231324c8e703a448ba50c15f099da3c
[clinton/guile-figl.git] / upstream-man-pages / man2 / glDrawElements.xml
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="glDrawElements">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glDrawElements</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glDrawElements</refname>
17 <refpurpose>render primitives from array data</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glDrawElements</function></funcdef>
23 <paramdef>GLenum <parameter>mode</parameter></paramdef>
24 <paramdef>GLsizei <parameter>count</parameter></paramdef>
25 <paramdef>GLenum <parameter>type</parameter></paramdef>
26 <paramdef>const GLvoid * <parameter>indices</parameter></paramdef>
27 </funcprototype>
28 </funcsynopsis>
29 </refsynopsisdiv>
30 <!-- eqn: ignoring delim $$ -->
31 <refsect1 id="parameters"><title>Parameters</title>
32 <variablelist>
33 <varlistentry>
34 <term><parameter>mode</parameter></term>
35 <listitem>
36 <para>
37 Specifies what kind of primitives to render.
38 Symbolic constants
39 <constant>GL_POINTS</constant>,
40 <constant>GL_LINE_STRIP</constant>,
41 <constant>GL_LINE_LOOP</constant>,
42 <constant>GL_LINES</constant>,
43 <constant>GL_TRIANGLE_STRIP</constant>,
44 <constant>GL_TRIANGLE_FAN</constant>,
45 <constant>GL_TRIANGLES</constant>,
46 <constant>GL_QUAD_STRIP</constant>,
47 <constant>GL_QUADS</constant>,
48 and <constant>GL_POLYGON</constant> are accepted.
49 </para>
50 </listitem>
51 </varlistentry>
52 <varlistentry>
53 <term><parameter>count</parameter></term>
54 <listitem>
55 <para>
56 Specifies the number of elements to be rendered.
57 </para>
58 </listitem>
59 </varlistentry>
60 <varlistentry>
61 <term><parameter>type</parameter></term>
62 <listitem>
63 <para>
64 Specifies the type of the values in <parameter>indices</parameter>. Must be one of
65 <constant>GL_UNSIGNED_BYTE</constant>, <constant>GL_UNSIGNED_SHORT</constant>, or
66 <constant>GL_UNSIGNED_INT</constant>.
67 </para>
68 </listitem>
69 </varlistentry>
70 <varlistentry>
71 <term><parameter>indices</parameter></term>
72 <listitem>
73 <para>
74 Specifies a pointer to the location where the indices are stored.
75 </para>
76 </listitem>
77 </varlistentry>
78 </variablelist>
79 </refsect1>
80 <refsect1 id="description"><title>Description</title>
81 <para>
82 <function>glDrawElements</function> specifies multiple geometric primitives
83 with very few subroutine calls. Instead of calling a GL function
84 to pass each individual vertex, normal, texture coordinate, edge
85 flag, or color, you can prespecify
86 separate arrays of vertices, normals, and so on, and use them to
87 construct a sequence of primitives with a single
88 call to <function>glDrawElements</function>.
89 </para>
90 <para>
91 When <function>glDrawElements</function> is called, it uses <parameter>count</parameter> sequential elements from an
92 enabled array, starting at <parameter>indices</parameter> to construct a sequence of
93 geometric primitives. <parameter>mode</parameter> specifies what kind of primitives are
94 constructed and how the array elements construct these primitives. If
95 more than one array is enabled, each is used. If
96 <constant>GL_VERTEX_ARRAY</constant> is not enabled, no geometric primitives are
97 constructed.
98 </para>
99 <para>
100 Vertex attributes that are modified by <function>glDrawElements</function> have an
101 unspecified value after <function>glDrawElements</function> returns. For example, if
102 <constant>GL_COLOR_ARRAY</constant> is enabled, the value of the current color is
103 undefined after <function>glDrawElements</function> executes. Attributes that aren't
104 modified maintain their previous values.
105 </para>
106 </refsect1>
107 <refsect1 id="notes"><title>Notes</title>
108 <para>
109 <function>glDrawElements</function> is available only if the GL version is 1.1 or greater.
110 </para>
111 <para>
112 <function>glDrawElements</function> is included in display lists. If <function>glDrawElements</function> is entered into a
113 display list,
114 the necessary array data (determined by the array pointers and
115 enables) is also
116 entered into the display list. Because the array pointers and
117 enables are client-side state, their values affect display lists
118 when the lists are created, not when the lists are executed.
119 </para>
120 </refsect1>
121 <refsect1 id="errors"><title>Errors</title>
122 <para>
123 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not an accepted value.
124 </para>
125 <para>
126 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>count</parameter> is negative.
127 </para>
128 <para>
129 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to an
130 enabled array or the element array and the buffer object's data store is currently mapped.
131 </para>
132 <para>
133 <constant>GL_INVALID_OPERATION</constant> is generated if <function>glDrawElements</function> is executed between
134 the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
135 </para>
136 </refsect1>
137 <refsect1 id="seealso"><title>See Also</title>
138 <para>
139 <citerefentry><refentrytitle>glArrayElement</refentrytitle></citerefentry>,
140 <citerefentry><refentrytitle>glColorPointer</refentrytitle></citerefentry>,
141 <citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
142 <citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>,
143 <citerefentry><refentrytitle>glEdgeFlagPointer</refentrytitle></citerefentry>,
144 <citerefentry><refentrytitle>glFogCoordPointer</refentrytitle></citerefentry>,
145 <citerefentry><refentrytitle>glGetPointerv</refentrytitle></citerefentry>,
146 <citerefentry><refentrytitle>glIndexPointer</refentrytitle></citerefentry>,
147 <citerefentry><refentrytitle>glInterleavedArrays</refentrytitle></citerefentry>,
148 <citerefentry><refentrytitle>glNormalPointer</refentrytitle></citerefentry>,
149 <citerefentry><refentrytitle>glSecondaryColorPointer</refentrytitle></citerefentry>,
150 <citerefentry><refentrytitle>glTexCoordPointer</refentrytitle></citerefentry>,
151 <citerefentry><refentrytitle>glVertexPointer</refentrytitle></citerefentry>
152 </para>
153 </refsect1>
154 <refsect1 id="Copyright"><title>Copyright</title>
155 <para>
156 Copyright <trademark class="copyright"></trademark> 1991-2006
157 Silicon Graphics, Inc. This document is licensed under the SGI
158 Free Software B License. For details, see
159 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
160 </para>
161 </refsect1>
162 </refentry>