[SDL] A problem with SDL_LoadBMP

Romi Kuntsman romik12345 at lycos.co.uk
Sun Jun 2 10:52:01 PDT 2002


Jonathan Atkins wrote:

> sketch at d3cod3.net wrote:
>
>>  I'm currently writing a game and I've come across a problem. I have a
>> string named curset that contains "tiles/bfloor.bmp" . This string is
>> loaded in from a file. When I go to put it in the SDL_LoadBMP function,
>> like so SDL_LoadBMP(curset) , it just returns as NULL. The image 
>> location
>> is right. What should I do?
>
> make sure the BMP file isn't RLE encoded, I don't know if that 
> compression is supported in SDL_LoadBMP...
>
> there's a comment in the SDL code:
>
> This code currently supports Win32 DIBs in uncompressed 8 and 24 bpp.


I recommend using DevIL (http://www.imagelib.org/) to load any image 
(works with lot's of image types, on lot's of compilers and lot's of 
platforms....).
AFAIK, it can load compressed BMP too...
What I don't know is how lo load the image into a SDL surface, since I 
use it with OpenGL textures, but it's probably quite easy.

RK.






More information about the SDL mailing list