I am having problem with mipmapping images loaded with DevIL.
My texture coordinates are imported from 3ds MAX and are correct. I
load the textures with DevIL and the textures are shown correctly.
However if I mipmap the image they get shown upside down.
Here is a code snippet of how I am doing my mipmapping:
imageLoaded = ilLoadImage(“my image.jpg”);
int sizeX = ilGetInteger(IL_IMAGE_WIDTH);
int sizeY = ilGetInteger(IL_IMAGE_HEIGHT);
ilTexImage (sizeX, sizeY, 1, 4, IL_RGBA, IL_UNSIGNED_BYTE, NULL);
ILubyte *imgData = ilGetData ();
if(imageLoaded == IL_FALSE){
printf("ERROR: gdlCreateMipMaps3: couldnt load image
");
exit(0);
}
glGenTextures(1, &textureName);
glBindTexture(GL_TEXTURE_2D, textureName);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, sizeX, sizeY, GL_RGB,
GL_UNSIGNED_BYTE, imgData);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR);
another problem i get when mipmapping as explained above is that bmp
files gets blue, they dont become upside down though, strange…