View Full Version : SDL_image don't load different images of .bmp

03-06-2005, 12:34 PM
My program run well if i load .bmp textures, but if put a different type of file, windows says to me "the program have to close..." and my opengl windows don't appear.
What have i done of wrong ?

i do this :

SDL_Surface *texture=IMG_Load("eyeball.tif") ;

03-06-2005, 12:44 PM
img_load returns and its value is 0x00000,
do you know what it means ?
i have also seen that in fact the program crashes here :
glTexImage2D(GL_TEXTURE_2D, 0, 3, texture->w,
texture->h,0,GL_RGB,GL_UNSIGNED_BYTE, texture->pixels);

03-06-2005, 05:38 PM
Firstly Your In the Wrong forum this is for OpenGL not SDL :rolleyes:

The reason your program is crashing is that you are trying to use a NULL pointer SDL_Surface *texture is set to NULL when you use IMG_Load with an invalid image type

Check the documentation for SDL and your IMG_Load function to see what image formats are supported.