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);
}