Archived

This topic is now archived and is closed to further replies.

Ertai

Display Lists

Recommended Posts

Ertai    122
Hey all, display lists seem great, but what if you, for example have a displau list to dray a number of tiles to screen, popping matrices for positioning from the GL_MODELVIEW_MATRIX stack, but you want all the tile to have different textures ... i tried specifying the texture names that should be bound with pointers, but the values are read from the pointers when the display list is compiled ... isn''t there some stack one could pop texture names from or something, than i could draw a whole load of tiles by filling up de GL_MODELVIEW_MATRIX and this namestack and just calling one display list ... i hope someone will understand what i mean ... thx in advance

Share this post


Link to post
Share on other sites
Dodger    122
You can bind the textures outside of the display lists. Meaning, instead of

list = glGenLists(1);
glNewList(...);
glBindTexture(...);
glBegin();
...
glEnd();
glEndList();

for(all_my_tiles){
glCallList(...);
}

do


list = glGenLists(1);
glNewList(...);
glBegin()
...
glEnd();
glEndList();

for(all_my_tiles){
glBindTexture(...);
glCallList(...);
}

That what you meant?

Share this post


Link to post
Share on other sites
Ertai    122
well, yeah, that would be one solution to the problem, but i allready thought of that myself ... but i was hoping for a faster / more elegant solution .. it would be great to be binding textures from within the display lists .. is there not something like a stack in opengl from wich you can pop Gl texture/list names ? Then you could draw all textures by just calling one display list ... very very fast i think ...

Share this post


Link to post
Share on other sites