Hi, first post here 
I was wondering if anyone knows why on Earth this is happening. Hereās
the code. It crashes after āsomething be wrong withā¦ā - so the
bitmap isnāt loading correctly or not at all, since DisplayFormat
thinks itās being given a NULL pointer? Any ideas on why the bitmap
wouldnāt load properly - itās a 100x75pxl 24bit bitmap drawn in MS
Paint⦠Iām new to SDL and quite eager to get on with something but
Iāve no idea whatās happening here (been trying to figure it out for a
few days too :P) Thanks for any ideas.
SDL_Surface * loadBitmap(char *file)
{
SDL_Surface *temp1, *temp2; cout << ātemp surfaces created\nā;
//temp1 = SDL_LoadBMP(file); cout << ābitmap loaded in\nā;
if((temp1 = SDL_LoadBMP(file)) == NULL)
{
cout << āsomething be wrong with that thar bitmapā;
}
temp2 = SDL_DisplayFormat(temp1); cout << āDisplay format set\nā;
SDL_FreeSurface(temp1); cout << ātemp1 freed\nā;
return temp2; cout << ātemp2 returning\nā;
}
Did you init the Screen before callinā this function ?
If you didnāt SDL_DisplayFormat dowsnāt know to whot format convert
your Image
Losky
El mar, 24-02-2004 a las 14:28, coles_sam_wargaming escribi?:> Hi, first post here 
I was wondering if anyone knows why on Earth this is happening. Hereās
the code. It crashes after āsomething be wrong withā¦ā - so the
bitmap isnāt loading correctly or not at all, since DisplayFormat
thinks itās being given a NULL pointer? Any ideas on why the bitmap
wouldnāt load properly - itās a 100x75pxl 24bit bitmap drawn in MS
Paint⦠Iām new to SDL and quite eager to get on with something but
Iāve no idea whatās happening here (been trying to figure it out for a
few days too :P) Thanks for any ideas.
SDL_Surface * loadBitmap(char *file)
{
SDL_Surface *temp1, *temp2; cout << ātemp surfaces created\nā;
//temp1 = SDL_LoadBMP(file); cout << ābitmap loaded in\nā;
if((temp1 = SDL_LoadBMP(file)) == NULL)
{
cout << āsomething be wrong with that thar bitmapā;
}
temp2 = SDL_DisplayFormat(temp1); cout << āDisplay format set\nā;
SDL_FreeSurface(temp1); cout << ātemp1 freed\nā;
return temp2; cout << ātemp2 returning\nā;
}
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl