PDA

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



airseb
03-06-2005, 01:34 PM
Hi,
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") ;

airseb
03-06-2005, 01: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);

UrbanLegend
03-06-2005, 06: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.