• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2Name
3
4    EXT_multi_draw_arrays
5    SUN_multi_draw_arrays
6
7Name Strings
8
9    GL_EXT_multi_draw_arrays
10    GL_SUN_multi_draw_arrays
11
12    (Note: this extension has been promoted from SUN to EXT status.
13    Implementations should advertise both name strings, and both EXT
14    and SUN versions of the new GL functions should be provided).
15
16Contact
17
18    Ron Bielaski, Sun (Ron.Bielaski 'at' eng.sun.com)
19    Jack Middleton, Sun (Jack.Middleton 'at' eng.sun.com)
20
21Status
22
23    Shipping
24
25Version
26
27    Version 4, June 18, 2013
28
29Number
30
31    148
32    OpenGL ES Extension #69
33
34Dependencies
35
36    OpenGL 1.1 is required. The language is written against the OpenGL 1.2
37    specification.
38
39Overview
40
41    These functions behave identically to the standard OpenGL 1.1 functions
42    glDrawArrays() and glDrawElements() except they handle multiple lists of
43    vertices in one call. Their main purpose is to allow one function call
44    to render more than one primitive such as triangle strip, triangle fan,
45    etc.
46
47New Procedures and Functions
48
49    void glMultiDrawArraysEXT( GLenum mode,
50			       const GLint *first,
51			       const GLsizei *count,
52			       GLsizei primcount)
53    Parameters
54    ----------
55	mode		Specifies what kind of primitives to
56			render. Symbolic constants GL_POINTS,
57			GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES,
58			GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN,
59			GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS,
60			and GL_POLYGON are accepted.
61
62	first		Points to an array of starting indices in
63			the enabled arrays.
64
65	count		Points to an array of the number of indices
66			to be rendered.
67
68	primcount	Specifies the size of first and count
69
70
71    void glMultiDrawElementsEXT( GLenum mode,
72				 GLsizei *count,
73				 GLenum type,
74				 const void * const *indices,
75				 GLsizei primcount)
76
77    Parameters
78    ----------
79	mode		Specifies what kind of primitives to render.
80			Symbolic constants GL_POINTS, GL_LINE_STRIP,
81			GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP,
82			GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP,
83			GL_QUADS, and GL_POLYGON are accepted.
84
85	count		Points to and array of the element counts
86
87	type		Specifies the type of the values in indices.
88			Must be  one  of GL_UNSIGNED_BYTE,
89			GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT.
90
91	indices		Specifies a  pointer to the location where
92			the indices are stored.
93
94	primcount	Specifies the size of the count array
95
96New Tokens
97
98    None
99
100Additions to Chapter 2 of the 1.2 Specification (OpenGL Operation)
101
102    Section 2.8 Vertex Arrays:
103
104    The command
105
106	void glMultiDrawArraysEXT( GLenum mode,
107				   const GLint* first,
108				   const GLsizei *count,
109				   GLsizei primcount)
110
111    Behaves identically to DrawArrays except that a list of arrays is
112    specified instead. The number of lists is specified in the primcount
113    parameter. It has the same effect as:
114
115	for(i=0; i<primcount; i++) {
116	   if (*(count+i)>0) DrawArrays(mode, *(first+i), *(count+i));
117	}
118
119    The command
120
121	void glMultiDrawElementsEXT( GLenum mode,
122				     GLsizei *count,
123				     GLenum type,
124				     const void **indices,
125				     GLsizei primcount)
126
127    Behaves identically to DrawElements except that a list of arrays is
128    specified instead. The number of lists is specified in the primcount
129    parameter. It has the same effect as:
130
131	for(i=0; i<primcount; i++) {
132	    if (*(count+i)>0) DrawElements(mode, *(count+i), type,
133					   *(indices+i));
134	}
135
136Additions to Chapter 3 of the 1.2 Specification (Rasterization)
137
138    None
139
140Additions to Chapter 4 of the 1.2 Specification (Per-Fragment Operations and
141
142    None
143
144Additions to Chapter 5 of the 1.2 Specification (Special Functions)
145
146    None
147
148Additions to Chapter 6 of the 1.2 Specification (State and State Requests)
149
150    None
151
152Additions to the GLX / WGL / AGL Specifications
153
154    None
155
156GLX Protocol
157
158    None
159
160Errors
161
162    GL_INVALID_ENUM is generated if <mode> is not an accepted value.
163
164    GL_VALUE is generated if <primcount> is negative.
165
166    GL_INVALID_OPERATION is generated if glMultiDrawArraysEXT or
167    glMultiDrawElementsEXT is executed between the execution of glBegin
168    and the corresponding glEnd.
169
170New State
171
172    None
173
174OpenGL ES interactions
175    This extension can also be implemented against OpenGL ES 1.x or
176	OpenGL ES 2.0. In those cases, remove references to glBegin, glEnd,
177	and to GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON.
178
179
180Revision History
181
182    Version 5, 2013/09/08 (Jon Leech) - Changed GLvoid -> void
183        (Bug 10412).
184    Version 4, 2013/06/18 (Jon Leech) - Added 'const' to
185	MultiDrawElementsEXT, too, based on feedback from Mesa.
186    Version 3, 2010/08/06 - Added 'const' to MultiDrawArraysEXT pointer
187	arguments to match the core GL entry point.
188    30/09/09 - Added fields from the new extension template and
189	interactions with OpenGL ES.
190    6/24/99 - Added fields from the new extension template.
191