Stebet
01-28-2003, 06:14 AM
I'm having a little problem with this extension. The thing is that i doesn't seem to generate the alpha channels? Here's my code:
if(bGL_SGIS_generate_mipmap)
{
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE );
if(bmpTexture->format->BytesPerPixel == 4)
glTexImage2D(GL_TEXTURE_2D, 0, (int)GL_RGBA, bmpTexture->w, bmpTexture->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, bmpTexture->pixels);
else
glTexImage2D(GL_TEXTURE_2D, 0, (int)GL_RGB, bmpTexture->w, bmpTexture->h, 0, GL_RGB, GL_UNSIGNED_BYTE, bmpTexture->pixels);
}
else
{
if(bmpTexture->format->BytesPerPixel == 4)
gluBuild2DMipmaps(GL_TEXTURE_2D, (int)GL_RGBA, bmpTexture->w, bmpTexture->h, GL_RGBA, GL_UNSIGNED_BYTE, bmpTexture->pixels);
else
gluBuild2DMipmaps(GL_TEXTURE_2D, (int)GL_RGB, bmpTexture->w, bmpTexture->h, GL_RGB, GL_UNSIGNED_BYTE, bmpTexture->pixels);
}
If i just do the gluBuild2DMipmaps everything goes as expected! Any ideas?
if(bGL_SGIS_generate_mipmap)
{
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE );
if(bmpTexture->format->BytesPerPixel == 4)
glTexImage2D(GL_TEXTURE_2D, 0, (int)GL_RGBA, bmpTexture->w, bmpTexture->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, bmpTexture->pixels);
else
glTexImage2D(GL_TEXTURE_2D, 0, (int)GL_RGB, bmpTexture->w, bmpTexture->h, 0, GL_RGB, GL_UNSIGNED_BYTE, bmpTexture->pixels);
}
else
{
if(bmpTexture->format->BytesPerPixel == 4)
gluBuild2DMipmaps(GL_TEXTURE_2D, (int)GL_RGBA, bmpTexture->w, bmpTexture->h, GL_RGBA, GL_UNSIGNED_BYTE, bmpTexture->pixels);
else
gluBuild2DMipmaps(GL_TEXTURE_2D, (int)GL_RGB, bmpTexture->w, bmpTexture->h, GL_RGB, GL_UNSIGNED_BYTE, bmpTexture->pixels);
}
If i just do the gluBuild2DMipmaps everything goes as expected! Any ideas?