Hi all!
About texture mapping, there is one problem with my loading function
Here is my code
void COGLTexture::LoadFromFile(char filename)
{
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGenTextures(1,&ID);
glBindTexture( GL_TEXTURE_2D, ID);
Image = auxDIBImageLoadA( (const char) filename );
Width = Image->sizeX;
Height = Image->sizeY;
gluBuild2DMipmaps( GL_TEXTURE_2D,
3,
Image->sizeX,
Image->sizeY,
GL_RGB,
GL_UNSIGNED_BYTE,
Image->data);
delete Image;
}
exactly, it is the code from codecolony and it works with sample picture “Tex1.bmp” which is used in codecolony page. when I replace this picture with another one, an error occurred: “Failed to open DIB file floor.bmp”. what could lead to this error? anyone can help me! (I compared properties of 2 pictures and they are completely the same);