Original Post
I am having a strange problem with my textures. My texture loading function loads a bitmap image, swaps it from BGR to RGB and then add an alpha component to each pixel. If the pixel is pink (255, 255, 0) then it sets the alpha to 0, otherwise 255, so that I can do alpha testing. However, when I create mipmaps, if I use RGBA mode then the textures look all crappy with banding across them. I create the mipmaps as follows:
gluBuild2DMipmaps(GL_TEXTURE_2D, 4, info->bmiHeader.biWidth, info->bmiHeader.biHeight, GL_RGBA, GL_UNSIGNED_BYTE, rgba);
However, if I use the same data but use RGB mode:
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, info->bmiHeader.biWidth, info->bmiHeader.biHeight, GL_RGB, GL_UNSIGNED_BYTE, rgba);
then the texures look fine. Any ideas? Is this a problem with gluBuild2DMipmaps or am I missing something?