View Full Version : texture object reuse (pointers)

01-20-2002, 08:35 PM
Hi, im wondering how i can go about doing something like this

// psuedo c code

surface[n].texname = "funkytexture.tga";
glGenTextures(1, &surface[n].tList);
bind and load surface[n].texname;

surface[o].texname = "funkytexture.tga";
if (surface[o].texname == surface[n].texname){
// surfaces use same texture so dont need to reload etc.
surface[o].tList = surface[n].tList;
// surface uses another texture load and bind
glGenTextures(1, &surface[o].tList);
bind and load surface[o].texname ;

anyway if you can show me a simple way to do that with correct c code i would really really appreciate it. Thanks in advance