So for example, I want to ether make it so the texture uses it's own alpha channel, or make it so a color like magenta is turned into transparent. I've written this function in hopes of making a transparent texture, but it doesn't seem to be working. Anyone know why?
Code: Select all
int LoadGLTextures()
{
sImage pcx;
//load our texture
loadPCX((u8*)drunkenlogo_pcx, &pcx);
image8to16trans(&pcx, 0);
for(unsigned i = 0; i < (TEXTURE_SIZE_128 * TEXTURE_SIZE_128); i++)
{
const u16 ALPHA_BIT = 1 << 15;
pcx.image.data16[i] |= ALPHA_BIT;
}
glGenTextures(1, &texture[0]);
glBindTexture(0, texture[0]);
glTexImage2D(0, 0, GL_RGBA, TEXTURE_SIZE_128 , TEXTURE_SIZE_128, 0, TEXGEN_TEXCOORD, pcx.image.data16);
imageDestroy(&pcx);
return TRUE;
}