PDA

View Full Version : glarrays in display list ?



jide
12-21-2001, 03:02 AM
i've already posted this message, but i hadn't got any precise answers.

can i do such a way ?

glEnableClientState( GL_VERTEX_ARRAY);
...
glVertexPointer(...);

glNewList();
...
glDraw*Element(...);
glEndList();

but it doesn't work !

without the list, that works ! But i want to keep the display lists.

jide
12-21-2001, 05:45 AM
last time i put this question, we said me that Quake 3 uses display list.

does anyone can confirm that ? where can i see that ?

Tolga Dalman
12-21-2001, 07:58 AM
i think you can't use displaylists here, because glEnableClientState() depends on the client, so it can't be precompiled.
nevertheless, convert your array into concrete vertices and then compile. it should work then.

best regards,
Tolga.

Spiral Man
12-21-2001, 08:37 AM
umm, ive drawn vertex arrays in display lists just fine, so it can be done.

try setting the vertex pointer in the display list...

you wrote glNewList(); is this just a typo? there should be a value that you pass to it (1 is good if you are only using one display list). if you are drawing more than one display list, you should be using glGenLists. if it is just a typo, then try what i suggested above. i think i had the same problem, and puting th vertex pointer call in the display list fixed it...

Tolga Dalman
12-21-2001, 08:22 PM
oh, i just recognized i was very wrong: you may use glEnableClientState() with displaylists. you only may not put this call INTO a list itself.
tnx, folks.
l8ers,
Tolga.

jide
12-25-2001, 04:58 AM
mery xmass !!

thanks for replies.

what said my book is that i must set client state outside the list, as calling gl arrays, but i can (or must) tell glDraw*Element() inside the list.

concerning glGenList..., it was just generic, not my real code (sorry SpiralMan).

my problem is that i have no display when using this method. but i'm sure this will increase my performance (then i could put the arrays in the vram !)

happy new year!

regards

JD