1GLDRAWARRAYS(3G) GLDRAWARRAYS(3G)
2
3
4
6 glDrawArrays - render primitives from array data
7
8
10 void glDrawArrays( GLenum mode,
11 GLint first,
12 GLsizei count )
13
14
16 mode Specifies what kind of primitives to render. Symbolic constants
17 GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES,
18 GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP,
19 GL_QUADS, and GL_POLYGON are accepted.
20
21 first Specifies the starting index in the enabled arrays.
22
23 count Specifies the number of indices to be rendered.
24
26 glDrawArrays specifies multiple geometric primitives with very few sub‐
27 routine calls. Instead of calling a GL procedure to pass each individ‐
28 ual vertex, normal, texture coordinate, edge flag, or color, you can
29 prespecify separate arrays of vertices, normals, and colors and use
30 them to construct a sequence of primitives with a single call to
31 glDrawArrays.
32
33 When glDrawArrays is called, it uses count sequential elements from
34 each enabled array to construct a sequence of geometric primitives,
35 beginning with element first. mode specifies what kind of primitives
36 are constructed, and how the array elements construct those primitives.
37 If GL_VERTEX_ARRAY is not enabled, no geometric primitives are gener‐
38 ated.
39
40 Vertex attributes that are modified by glDrawArrays have an unspecified
41 value after glDrawArrays returns. For example, if GL_COLOR_ARRAY is
42 enabled, the value of the current color is undefined after glDrawArrays
43 executes. Attributes that aren't modified remain well defined.
44
46 glDrawArrays is available only if the GL version is 1.1 or greater.
47
48 glDrawArrays is included in display lists. If glDrawArrays is entered
49 into a display list, the necessary array data (determined by the array
50 pointers and enables) is also entered into the display list. Because
51 the array pointers and enables are client-side state, their values
52 affect display lists when the lists are created, not when the lists are
53 executed.
54
56 GL_INVALID_ENUM is generated if mode is not an accepted value.
57
58 GL_INVALID_VALUE is generated if count is negative.
59
60 GL_INVALID_OPERATION is generated if glDrawArrays is executed between
61 the execution of glBegin and the corresponding glEnd.
62
64 glArrayElement(3G), glColorPointer(3G), glDrawElements(3G),
65 glDrawRangeElements(3G), glEdgeFlagPointer(3G), glGetPointerv(3G),
66 glIndexPointer(3G), glInterleavedArrays(3G), glNormalPointer(3G),
67 glTexCoordPointer(3G), glVertexPointer(3G)
68
69
70
71 GLDRAWARRAYS(3G)