1. Enable array
in the 1.1 glenableclientstate (Gl_vertex_array), and Gldisableclientstate (Gl_vertex_array);
Glenablevertexattribarray (*); and Gldisablevertexattribarray (*);
2. Specifying array data
Glvertexattribpointer (gluint index,glint size,glenum type,glboolean normalized, Glsizei stride,const GLvoid* pointer);
the index represents the attribute indexed value,size represents the number of components for each vertex property (this value must be 1, 2, 3, or 4).type represents the component data type,normalized represents whether the data type is normalized (normalized),When a value in an array is accessed and converted to a floating-point value, ifnormalizedis set to Gl_true, which means that the value of the integer is mapped to the interval [ -1,1] (signed integer), or the interval [0,1] (unsigned integer), and conversely, these values are converted directly to floating point values without normalization. stride represents the offset between successive vertex attributes, pointer the first address of the array.
if a buffer object with a nonzero name is bound to the Gl_array_buffer target (see Glbindbuffer) and a fixed-point attribute array is specified, thenPointerThe byte offset that is treated as the buffer object data store. to enable or disable array of vertex attributes, call Glenablevertexattribarray and Gldisablevertexattribarray incoming parametersIndex. If enabled, then whenGldrawarraysorGldrawelementswhen called, an array of vertex attributes is used.
This article from "Progress a little every day" blog, reproduced please contact the author!
OpenGL Learning notes-vertex arrays