GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


Manpage of GLDRAWELEMENTS

GLDRAWELEMENTS

Index
 

NAME

glDrawElements - render primitives from array data

 

C SPECIFICATION

void f3glDrawElementsfP( GLenum fImodefP,
f2modefP
Specifies what kind of primitives to render.
Symbolic constants
%f3GL_POINTSfP,
%f3GL_LINE_STRIPfP,
%f3GL_LINE_LOOPfP,
%f3GL_LINESfP,
%f3GL_TRIANGLE_STRIPfP,
%f3GL_TRIANGLE_FANfP,
%f3GL_TRIANGLESfP,
%f3GL_QUAD_STRIPfP,
%f3GL_QUADSfP,
and %f3GL_POLYGONfP are accepted. 
f2countfP
Specifies the number of elements to be rendered.
f2typefP
Specifies the type of the values in f2indicesfP. Must be one of %f3GL_UNSIGNED_BYTEfP, %f3GL_UNSIGNED_SHORTfP, or %f3GL_UNSIGNED_INTfP.
f2indicesfP
Specifies a pointer to the location where the indices are stored.
 

DESCRIPTION

%f3glDrawElementsfP specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL function to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and so on and use them to construct a sequence of primitives with a single call to %f3glDrawElementsfP. When %f3glDrawElementsfP is called, it uses f2countfP sequential elements from an enabled array, starting at f2indicesfP to construct a sequence of geometric primitives. f2modefP 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. If %f3GL_VERTEX_ARRAYfP is not enabled, no geometric primitives are constructed. Vertex attributes that are modified by %f3glDrawElementsfP have an unspecified value after %f3glDrawElementsfP returns. For example, if %f3GL_COLOR_ARRAYfP is enabled, the value of the current color is undefined after %f3glDrawElementsfP executes. Attributes that aren't modified maintain their previous values.  

NOTES

%f3glDrawElementsfP is available only if the GL version is 1.1 or greater. %f3glDrawElementsfP is included in display lists. If %f3glDrawElementsfP is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client-side state, their values affect display lists when the lists are created, not when the lists are executed.  

ERRORS

%f3GL_INVALID_ENUMfP is generated if f2modefP is not an accepted value. %f3GL_INVALID_VALUEfP is generated if f2countfP is negative. %f3GL_INVALID_OPERATIONfP is generated if %f3glDrawElementsfP is executed between the execution of %f3glBeginfP and the corresponding %f3glEndfP.  

SEE ALSO

%f3glArrayElement(3G)fP, %f3glColorPointer(3G)fP, %f3glDrawArrays(3G)fP, %f3glDrawRangeElements(3G)fP, %f3glEdgeFlagPointer(3G)fP, %f3glGetPointerv(3G)fP, %f3glIndexPointer(3G)fP, %f3glInterleavedArrays(3G)fP, %f3glNormalPointer(3G)fP, %f3glTexCoordPointer(3G)fP, %f3glVertexPointer(3G)fP


 

Index

NAME
C SPECIFICATION
DESCRIPTION
NOTES
ERRORS
SEE ALSO