Re: SDL_LoadBMP question
Todd Lang <todd.lang <at> kiyote.ca>
2005-03-01 13:07:58 GMT
> somebody who should know BMP files, Microsoft should be the one. So
> maybe there's a point on why SDL may be missing the alpha channel (may
> someone involved with this part step up and confirm it?).
It does seem that the alpha channel is loaded as I'm definately getting
some per-pixel alpha effect in my experimentations. Of course, I could be
misinterpreting some other effect. I'm still having a great deal of
difficulty remembering all the tricks to getting alpha-blended images to
the display, but I'm getting there. :)
> But getting back to the point, i.e., helping you solve your problem,
> one solution is to separate the alpha channel on Photoshop and save it
> as a gray scale bitmap. Then you load your color BMP file, convert it to
> a 32 bits surface and fill the alpha values from the second file which
> contains the alpha from the complete image.
Would you load the image and the alpha, then create another surface at
32bpp, then blit the image on to the surface, and then use... what, some
kind of SetPixel command to push the alpha over? Just not sure of what
the approach would be here.
> Another option is to make a TGA loader, which is very simple - check
> http://organicbit.com/closecombat/formats/tga.html for some info, it's
> very straightforward.
Actually, thanks very much for that link. That's probably one of the
clearest explanations of the file format that I've seen. And while I can
definately load the image in to memory, I'm having a great deal of
difficulty in creating the SDL_RWOps structure, due to the large number of
pointers it uses. (As I mentioned before I'm writing this code in the