Click or drag to resize

glDrawElements Method (glPrimitiveType, Byte)

Render primitives from array data, using supplied indices.

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static void DrawElements(
	glPrimitiveType type,
	byte[] indices
)

Parameters

type
Type: OooglesglPrimitiveType
specifies what kind of primitives to render.
indices
Type: SystemByte
array of indices (of type byte).
Exceptions
ExceptionCondition
GLExceptionInvalidFramebufferOperation if the currently bound framebuffer is not framebuffer complete.
Remarks
DrawElements specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL function to pass each vertex attribute, you can use VertexAttribute to prespecify separate arrays of vertex attributes and use them to construct a sequence of primitives with a single call to DrawElements.

When DrawElements is called, it uses indices to locate vertices in the vertex array. type specifies what kind of primitives are constructed and how the array elements construct these primitives. If more than one array is enabled, each is used.

To enable and disable a generic vertex attribute array, call Enable and Disable.

Note: if the current program object, as set by Use, is invalid, rendering results are undefined. However, no error is generated for this case.

OpenGL API: glDrawElements

See Also