<Fluxx>,
The array of color components can specify the color of each vertex in vertex array. For example, if you have 3 vertices in your vertex array to create a triangle, you will have vertex coords array with 3 of (xyz) elements and color array with 3 of (r,g,b,a) elements. (same number of elements in vertex array)
GLfloat vertices[] = { v1x, v1y, v1z,
v2x, v2y, v2z,
v3x, v3y, v3z };
GLubyte colors[] = { v1r, v1g, v1b, v1a,
v2r, v2g, v2b, v2a,
v3r, v3g, v3b, v3a };
If you want to set all vertices to red;
GLubyte colors[] = { 255, 0, 0, 255,
255, 0, 0, 255,
255, 0, 0, 255 };
In redering time, you can call glColorPointer() like this;
glColorPointer(4, GL_UNSIGNED_BYTE, 0, colors);
==song==