PDA

View Full Version : Display lists and textues... Something I should know?



03-29-2000, 03:24 AM
Hi!

Is it possible to bind a texture inside a display list... My code works if I bind it just before calling the display list, but not in the display list...

Cheers...

dans
03-29-2000, 05:55 PM
Yes this should work

Here is some sample code..


myDisplayListList = glGenLists(1); // start generation of the list
glNewList(myDisplayList, GL_COMPILE);
glBindTexture(GL_TEXTURE_2D, tList[myTextureObject]);
glBegin (GL_TRIANGLES);

...
...
...

glEnd ();
glDisable(GL_TEXTURE_2D);
glEndList();

Bob
03-30-2000, 02:08 AM
Hello

Can the problem be that you bind new textures INSIDE glBegin() and glEnd()? Not sure you can do that. To change texture, this might work.

glNewList()
glBindTexture() bind texture one
glBegin() draw first part
.
.
.
glEnd()
glBindTexture() bind texture two
glBegin() draw second part
.
.
.
glEnd()
glEndList()

Bob

Gorg
03-30-2000, 09:26 AM
You can actually do it like they said, but from experience puting glBindtexture in the display list gave me a big performance hit.