 | glDrawElements Method (glPrimitiveType, Byte, Int32, Int32) |
Render primitives from array data, using supplied indices.
Namespace:
Ooogles
Assembly:
Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic static void DrawElements(
glPrimitiveType type,
byte[] indices,
int first,
int count
)
Public Shared Sub DrawElements (
type As glPrimitiveType,
indices As Byte(),
first As Integer,
count As Integer
)
public:
static void DrawElements(
glPrimitiveType type,
array<unsigned char>^ indices,
int first,
int count
)
static member DrawElements :
type : glPrimitiveType *
indices : byte[] *
first : int *
count : int -> unit
Parameters
- type
- Type: OooglesglPrimitiveType
specifies what kind of primitives to render. - indices
- Type: SystemByte
array of indices (of type byte). - first
- Type: SystemInt32
index to the first index in indices to use. - count
- Type: SystemInt32
number of indices in indices to use, starting at count.
ExceptionsException | Condition |
---|
GLException | InvalidFramebufferOperation 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