View Full Version : about multiple vertex array
phanie
05-04-2001, 05:21 AM
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.
Nutty
05-04-2001, 05:55 AM
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
phanie
05-04-2001, 06:44 AM
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
Nutty
05-04-2001, 07:19 AM
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. http://www.opengl.org/discussion_boards/ubb/smile.gif
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
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.