glDrawArrays Function

Syntax

GL_APICALL void GL_APIENTRY glDrawArrays(
     GLenum mode,
     GLint first,
     GLsizei count
);

Parameters

Name Description
in mode Primitive mode
in first Starting index of the array of vertex data to render
in count Amount of vertex data to render

Return Values

No values are returned.

Description

Uses a vertex array to render primitives.

Accesses a vertex data array in order.

Set mode to one of the following values when the geometry shader is not in use.

GL_TRIANGLES Triangles
GL_TRIANGLE_STRIP Triangle strip
GL_TRIANGLE_FAN Triangle fan

Specify a value of GL_GEOMETRY_PRIMITIVE_DMP when the geometry shader is in use.

This function generates the following errors.

GL_INVALID_ENUMThe mode argument was set to an invalid value.
GL_INVALID_FRAMEBUFFER_OPERATIONThe framebuffer was configured incorrectly.
GL_INVALID_OPERATIONThis function was called without any command-list objects bound.
GL_INVALID_OPERATIONThe mode argument was either set to GL_GEOMETRY_PRIMITIVE_DMP when a geometry shader had not been linked to the current program, or it was set to a value other than GL_GEOMETRY_PRIMITIVE_DMP when a geometry shader had been linked to the current program.

Also, because this function performs a process for each state corresponding to nngxValidateState, when using the gl API, an error may occur for reasons not listed above. In this case, it is possible to narrow down the reason for the error by calling the nngxValidateState function for each state before calling this function.

Revision History

2011/06/15
Added internal processes and how to check error causes
2010/01/07
Initial version.

CONFIDENTIAL