Loading pure RLE ( not Bitmap ) Image

Thanks David,
I will try it out.

Dominique Louis.

David Olofson wrote:> RLE (Run-Length Encoding) is a vague term, and can be pretty much

anything that’s based on the general idea of encoding sequences of
identical (or even similar) objects in some way, for speed and/or

That said, there is a (relatively) easy way:

  1. Create a surface (SDL_CreateRGBSurface()) with a fixed,
    known pixel format; 24 bit RGB, 32 bit RGBA or whatever.

  2. Hack your own decoder that loads the file into a buffer
    and decodes it into the ‘pixels’ array of the surface.

  3. Use SDL_ConvertSurface(), SDL_DisplayFormat() or
    whatever you need, to convert the surface to a suitable
    pixel format for your application - if you need to
    convert it at all. (Usually not really necessary unless
    speed is critical. SDL converts on-the-fly as needed.)

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’