about multiple vertex array

Hello,
I would like to have more informations and if possible a code example, about multiple vertex array.
Can I have multiple arrays simultaneously or only not ?
Thank you.

nb: excuse my question and my english, i’m a beginner in both opengl and english.

Do you mean having a vertex array and a color array, or having two vertex arrays at the same time?

If it’s the latter, you can have as many as you want. But you can only tell gl about 1 at a time.

Nutty

Ok, so if i want to specify more than one vertex array,
if i undersatand, i have to do
glEnableClientState(…);
glDiasableClientState(…);
between each array.
thanks

Between? er… you’ve probably got it right. but just to be sure… heres some pseudo code.

glEnableClientState(GL_VERTEX_ARRAY);

For number of vertex arrays.
glVertexPointer(array [i]);

glDrawElements(.....);

End for.

glDisableClientState(GL_VERTEX_ARRAY);

or something like that.

Nutty

Originally posted by phanie:
Ok, so if i want to specify more than one vertex array,
if i undersatand, i have to do
glEnableClientState(…);
glDiasableClientState(…);
between each array.
thanks

no u can leave glEnableClientState(…) enabled the whole time, until u dont need it any more

thus u can right this.

glVertexPointer(…)
glDrawElements()
glVertexPointer(…)
glDrawElements()
glVertexPointer(…)
glDrawElements()
etc

personally i stick
glEnableClientState() GL_VERTEX + GL_TEXTCOORD0
in a init function so its enable the whole time, other states eg colours, normals, texccord1 i do enable/disable when they’re not needed