rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man4 / glDrawArraysInstanced.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="glDrawArraysInstanced">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2010</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glDrawArraysInstanced</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glDrawArraysInstanced</refname>
17 <refpurpose>draw multiple instances of a range of elements</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glDrawArraysInstanced</function></funcdef>
23 <paramdef>GLenum <parameter>mode</parameter></paramdef>
24 <paramdef>GLint <parameter>first</parameter></paramdef>
25 <paramdef>GLsizei <parameter>count</parameter></paramdef>
26 <paramdef>GLsizei <parameter>primcount</parameter></paramdef>
27 </funcprototype>
28 </funcsynopsis>
29 </refsynopsisdiv>
30 <refsect1 id="parameters"><title>Parameters</title>
31 <variablelist>
32 <varlistentry>
33 <term><parameter>mode</parameter></term>
34 <listitem>
35 <para>
36 Specifies what kind of primitives to render. Symbolic constants <constant>GL_POINTS</constant>,
37 <constant>GL_LINE_STRIP</constant>, <constant>GL_LINE_LOOP</constant>, <constant>GL_LINES</constant>,
38 <constant>GL_TRIANGLE_STRIP</constant>, <constant>GL_TRIANGLE_FAN</constant>, <constant>GL_TRIANGLES</constant>
39 <constant>GL_LINES_ADJACENCY</constant>, <constant>GL_LINE_STRIP_ADJACENCY</constant>,
40 <constant>GL_TRIANGLES_ADJACENCY</constant>, <constant>GL_TRIANGLE_STRIP_ADJACENCY</constant> and <constant>GL_PATCHES</constant>
41 are accepted.
42 </para>
43 </listitem>
44 </varlistentry>
45 <varlistentry>
46 <term><parameter>first</parameter></term>
47 <listitem>
48 <para>
49 Specifies the starting index in the enabled arrays.
50 </para>
51 </listitem>
52 </varlistentry>
53 <varlistentry>
54 <term><parameter>count</parameter></term>
55 <listitem>
56 <para>
57 Specifies the number of indices to be rendered.
58 </para>
59 </listitem>
60 </varlistentry>
61 <varlistentry>
62 <term><parameter>primcount</parameter></term>
63 <listitem>
64 <para>
65 Specifies the number of instances of the specified range of indices to be rendered.
66 </para>
67 </listitem>
68 </varlistentry>
69 </variablelist>
70 </refsect1>
71 <refsect1 id="description"><title>Description</title>
72 <para>
73 <function>glDrawArraysInstanced</function> behaves identically to <citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>
74 except that <parameter>primcount</parameter> instances of the range of elements are executed and the value of the internal counter
75 <parameter>instanceID</parameter> advances for each iteration. <parameter>instanceID</parameter> is an internal 32-bit integer counter
76 that may be read by a vertex shader as <constant>gl_InstanceID</constant>.
77 </para>
78 <para>
79 <function>glDrawArraysInstanced</function> has the same effect as:
80 <programlisting><![CDATA[ if ( mode or count is invalid )
81 generate appropriate error
82 else {
83 for (int i = 0; i < primcount ; i++) {
84 instanceID = i;
85 glDrawArrays(mode, first, count);
86 }
87 instanceID = 0;
88 }]]></programlisting>
89 </para>
90 </refsect1>
91 <refsect1 id="errors"><title>Errors</title>
92 <para>
93 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not one of
94 the accepted values.
95 </para>
96 <para>
97 <constant>GL_INVALID_OPERATION</constant> is generated if a geometry shader is active and <parameter>mode</parameter>
98 is incompatible with the input primitive type of the geometry shader in the currently installed program object.
99 </para>
100 <para>
101 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>count</parameter> or <parameter>primcount</parameter> are negative.
102 </para>
103 <para>
104 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to an
105 enabled array and the buffer object's data store is currently mapped.
106 </para>
107 </refsect1>
108 <refsect1 id="seealso"><title>See Also</title>
109 <para>
110 <citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
111 <citerefentry><refentrytitle>glDrawElementsInstanced</refentrytitle></citerefentry>
112 </para>
113 </refsect1>
114 <refsect1 id="Copyright"><title>Copyright</title>
115 <para>
116 Copyright <trademark class="copyright"></trademark> 2010 Khronos Group.
117 This material may be distributed subject to the terms and conditions set forth in
118 the Open Publication License, v 1.0, 8 June 1999.
119 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
120 </para>
121 </refsect1>
122 </refentry>