Display Lists
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
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?
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?
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 ...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement