With glDrawArrays, you must enable glVertexPointer to set vertex data.
In the same way, you can also set a pointer to a memory for colors.
It comes down to these challenges:
glEnableClientState (GL_VERTEX_ARRAY); glEnableClientState (GL_COLOR_ARRAY);
Btw - texture coordinates are treated the same. To do this, use GL_TEXCOORD_ARRAY and glTexCoordPointer.
source share