On Sun, 8 Aug 2010 09:09:43 +0200
"Skybuck Flying" <IntoTheFuture@hotmail.com> wrote:
> However I cannot find any documentation which specifies in what order
> the color components are ?
Let's take a look in the specification:
| For each enabled array, it is as though the corresponding command from
| section 2.7 or section 2.6.2 were called with a pointer to element i.
| For the vertex array, the corresponding command is
| Vertex[ size][ type]v, where size is one of [2,3,4], and type is one
| of [s,i,f,d], corresponding to array types short, int, float, and
| double respectively. The corresponding commands for the edge flag,
| texture coordinate, color, color index, and normal arrays are
| EdgeFlagv, TexCoord[ size][ type]v, Color[ size][ type]v,
| Index[ type]v, and Normal[ type]v, respectively. If the vertex array
| is enabled, it is as though Vertex[ size][ type]v is executed last,
| after the executions of the other corresponding commands.
Ah, they're refering us to other sections of the specification, so what
do 2.7 and 2.6.2 tell us?
2.6.2 is about the glBegin, glEnd paradigm, and covers edge pointers.
So what's in 2.7? Surprise: It's the description of the commands to use
between glBegin and glEnd.
Now it might be a good idea to know about the semantics of OpenGL
commands. And if you read the specification like it should be read,
you're not cherry picking, but also take into account the whole things.
So there's chapter 2.3 "GL Command Syntax".
It's too long to cite here, but essentially it answers your very
question. So I strongly suggest you read it:
In your case it boils down, that the order of the elements in the
arrays is the same order in which you supply the elements as parameters
for glVertex, glColor, glNormal, glTexCoord, glVertexAttrib, and so on.
In the order you see them in your source code, so ignoring any
specifics of calling convention and in which order to supply
function call parameters on the machine level).
Elements are not packed (i.e. merging 4 bytes in a int32 is disallowed).
Data is supplied in the client's machine endianess (if the server has
different endianess the GL is responsible for conversion).