Next | Prev | Up | Top | Contents | Index

Rendering the Arrays

By default all the arrays are disabled; they are not accessed when either glArrayElementEXT() or glDrawArraysEXT() is called. To enable or disable an individual array, call glEnable() or glDisable() with cap set to an appropriate value, as specified in Table 8-1.

Tokens for Enabling Arrays
Array Specification CommandEnable Token
glVertexPointerEXT GL_VERTEX_ARRAY_EXT
glNormalPointerEXT GL_NORMAL_ARRAY_EXT
glColorPointerEXT GL_COLOR_ARRAY_EXT
glIndexPointerEXT GL_INDEX_ARRAY_EXT
glTexCoordPointerEXT GL_TEXTURE_COORD_ARRAY_EXT
glEdgeFlagPointerEXT GL_EDGE_FLAG_ARRAY_EXT

When glArrayElementEXT() is called, a single vertex is drawn, using vertex and attribute data taken from location i of the enabled arrays.

Even if GL_VERTEX_ARRAY_EXT is not enabled, the glArrayElementEXT() function executes. No drawing occurs in this case, but the attributes corresponding to enabled arrays are modified.

When glDrawArraysEXT() is called, count sequential elements from each enabled array are used to construct a sequence of geometric primitives, beginning with element first. The mode parameter specifies what kind of primitives are constructed, and how the array elements are used to construct these primitives. Accepted values for mode are GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON. If GL_VERTEX_ARRAY_EXT is not enabled, no geometric primitives are generated.

Vertex attributes that are modified by glDrawArraysEXT() have an unspecified value after glDrawArraysEXT() returns. For example, if GL_COLOR_ARRAY_EXT is enabled, the value of the current color is undefined after glDrawArraysEXT() executes. Attributes that aren't modified remain well defined.

If an error is generated during execution of glDrawArraysEXT(), no other operations take place and the state does not change.

Although it is not an error to respecify an array between the execution of glBegin() and the corresponding execution of glEnd(), the result of such respecification is undefined. Static array data may be read and cached by the implementation at any time. If static array data are modified by the application, the results of any subsequent glArrayElementEXT() or glDrawArraysEXT() calls are undefined.


Next | Prev | Up | Top | Contents | Index