Multitexturing-something I'm overlooking or texture loader bugged?
A problem I've been having for a short time, for some reason any texture I pass to the first unit will also be passed to the second. Does anyone see something I'm missing or does it seem to be something wrong with the texture loader itself. (I did not write it) If the latter is there any common mistake that might have been made to cause this I could look for?
<code>
glBindTexture(GL_TEXTURE_2D, Texture[0]);
tgaLoad("maptex.tga", &the_image, TGA_FREE | TGA_COMPRESS);
tgaSetTexParams(GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, GL_MODULATE);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, Texture[1]);
tgaLoad("detail.tga", &the_image, TGA_FREE | TGA_COMPRESS);
tgaSetTexParams(GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, GL_MODULATE);
glEnable(GL_TEXTURE_2D);
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, Texture[0]);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 2);
glBindTexture(GL_TEXTURE_2D,Texture[1]);
</code>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement