Why don't you roll your own archive format like Blizzard?
thats exactly what i want to do ...
and it is unlikely to have any features you can't do with PNG.
I just dont want to put PNGs inside it but bitmaps / pixel maps with some modified / additional header.
The BMP spec does support 32bit images. However most apps do not recognise it.
32bpp images are 'allowed' but the additional 8bits are used for faster processing with int32 and not for alpha.
Doesn't TIFF support meta data? Could you embed extra stuff in your image that way?
I want to make a Sprite-Class + Loading code within constructor or a static function which loads the meta data to class' variables.
sprite mySprite = LoadSprite("path/to/image.spr");
For tiffs i'd need to once open the file for the meta data only and once for the pixel data via IMG_Load(...). It is the same thing as if i'd use a additional text file because the file(s) will be archived (map file, data file) or streamed (user pictures / avatars) anyway.
Never mind the discussion about using custom format or not - my question was how to load the pixel buffer to an SDL_Surface? My idea was to create a surface with
uint32* pixel = ...;
SDL_Surface* tmpSurf = SDL_CreateRGBSurface(..., pixel);
// and then convert it with
SDL_Surface* mySurf = SDL_ConvertSurface(format, mySurface, ...);
Is there another, better way?
Btw. I even could use a Windows Bitmap with a 'legal' header but a moved data address (see the first uint32 within the dib information header
) so normal image viewers can display my image, if i wanted to. The only 'illegal' thing would be the additional alpha channel...