I load two textures using this code:
flare.loadImage("flare.png"); flareText.allocate(512,512,GL_RGBA); flareText.loadData(flare.getPixels(),512,512,GL_RGBA); cloud.loadImage("cloud.png"); cloudText.allocate(512,512,GL_RGBA); cloudText.loadData(cloud.getPixels(),512,512,GL_RGBA);
I then wanted to put the flare texture on a quad like this:
glEnable(flareText.getTextureData().textureTarget); glBegin(GL_QUADS); .... //vertices glEnd();
However it turned out the program had actually used the cloud texture. Appareantly the last loaded texture was used… Ofcourse, that’s not what I wanted.
Anybody have any ideas what I could be doing wrong?