Blending surfaces

I have just few days ago started learning the use of SDL in my
projects.I simply can’t find a way to blend two surfaces with methods
like add or difference. How can I do this? Surely there is a simple way
but I may be simple enough not to find it :wink:

Thanks,

Dani

Hi Dani,

Unless you’re using OpenGL, the only way to blend 2 surfaces in SDL is to use
low level pixel bashing routines. But SDL gives you easy access to the
pixels.

That’s what we’ve done at JEDI-SDL, so If you’re writing using a Pascal
compiler, you can just use our routines. They’re fast too. I use them all the
time in my stuff.

I don’t know about any C alternatives. But unless I’m mistaken, there is no
direct SDL alternative.

Later

JasonOn Tuesday 21 May 2002 7:44 pm, Dani P?rn?nen wrote:

I have just few days ago started learning the use of SDL in my
projects.I simply can’t find a way to blend two surfaces with methods
like add or difference. How can I do this? Surely there is a simple way
but I may be simple enough not to find it :wink:

Thanks,

Dani


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

If you mean blend two surfaces like a crossfade, you can always blit a
surface onto the screen, then blit another surface on top of it that has
it’s alpha set to 50%, and that would produce a sort of blending effect.
That’s probably not what you’re looking for but it’s simple. :-)On Tue, 2002-05-21 at 11:44, Dani P?rn?nen wrote:

I have just few days ago started learning the use of SDL in my
projects.I simply can’t find a way to blend two surfaces with methods
like add or difference. How can I do this? Surely there is a simple way
but I may be simple enough not to find it :wink:

Thanks,

Dani


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Chris
@Christopher_Thielen