[SDL] RGBA->RGBA blitting again

MagerValp MagerValp at cling.gu.se
Thu Nov 27 07:18:01 PST 2003


>>>>> "DO" == David Olofson <david at olofson.net> writes:

DO> Yes... That's because RGBA->RGBA blits don't apply the source
DO> alpha the way you'd expect. (Performance reasons, I guess.)

Well RGBA->RGBA blits as they are now are basically useless... :/

MV> http://www.cling.gu.se/~cl3polof/10x12yellow.bmp

DO> Nice little font, BTW. Reminds me of great old Atari ST and Amiga
DO> games. :-)

Heh, thanks. The final font will be released with a BSD license,
together with the rest of my code, so feel free to use it. That copy
there isn't finished though.

MV> Is there a workaround for this?

Gabriel> I had to write a custom blitter and use dst_alpha = max
Gabriel> (dst_alpha, src_alpha)

DO> If you need massive amounts of text, you're probably better off
DO> rendering the overlay surfaces with your own blitting code, that
DO> applies/combines alpha the way you want.

I was hoping there was a way of tricking SDL into doing the job for
me, but I guess not. 1-bit alpha is just going to have to do for now.

DO> BTW, don't ask for a 32 bpp display unless you absolutely need it
DO> to be exactly 32 bpp.

OK. Well, any truecolor mode should work fine. I suppose I should call
SDL_GetVideoInfo and check vfmt instead of just asking for 32.

Thanks!

-- 
    ___          .     .  .         .       . +  .         .      o   
  _|___|_   +   .  +     .     +         .  Per Olofsson, arkadspelare
    o-o    .      .     .   o         +          MagerValp at cling.gu.se
     -       +            +    .     http://www.cling.gu.se/~cl3polof/




More information about the SDL mailing list