🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

OpenGL Texturing Problem

Started by
-1 comments, last by LordChaos 24 years, 8 months ago
I am at my wits end here. I am trying to load a number of textures, from .TGA files (my code for that is fine). I am using texture objects, ie:


GLuint *textures;
textures = new GLuint[2];
*load textures/put in texture object*


The problem is, when I try to draw polygons with the multiple textures, ie:


glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE, GL_DECAL);
glBindTexture(GL_TEXTURE_2D, textures); //"I" being assigned previously<BR>glBegin(GL_QUADS);<BR>//Then the normal..<BR>glTexCoord2d(x,y); glVertex3f(x1,y1,x2,y2);<BR>//etc..<BR>glEnd();<P>And then draw another polygon with a different texture, the new texture looks as if it's sort of been mapped over the old one - ie the same old texture with a new colour. <br><BR>I thought that using GL_DECAL avoided that? Or is there something I'm missing? I'm using all the standard texture parameters in glTexParameteri(…);<br><BR>Any ideas?

This topic is closed to new replies.

Advertisement