[SDL 1.3] Negative Blending?

When I finally decided to upgrade to SDL 1.3, I was surprised to find that Negative blending is not present while
Additive blending is. Where the algorithm for add blending would be…

Code:
dst = min(dst + (src * A), 255)

the algorithm for negative blending would be…

Code:
dst = max(dst - (src * A), 0)

In such a simple representation, it doesn’t seem that negative blending would be all that difficult to include in the
form that additive blending is now, although if it is not supported by hardware the way additive is then that could
be a problem.

Is there an easy way for such a thing to be implemented? Is there a workaround that people have
found that can implement such a feature with 1.3 as-is?

Thanks.

I believe this came up in discussion on the mailing list when these features
were first included. I guess if someone wrote a patch, it would be
included…On Wed, Sep 8, 2010 at 1:19 PM, Park <kyle_park0 at hotmail.com> wrote:

When I finally decided to upgrade to SDL 1.3, I was surprised to find
that Negative blending is not present while
Additive blending is. Where the algorithm for add blending would be…

Code:

dst = min(dst + (src * A), 255)

the algorithm for negative blending would be…

Code:

dst = max(dst - (src * A), 0)

In such a simple representation, it doesn’t seem that negative blending
would be all that difficult to include in the
form that additive blending is now, although if it is not supported by
hardware the way additive is then that could
be a problem.

Is there an easy way for such a thing to be implemented? Is there a
workaround that people have
found that can implement such a feature with 1.3 as-is?

Thanks.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

Yep, it’s certainly easy to add, but I wanted to keep only the most commonly
used blending modes just for our sanity. If you have a need for this and
want to write a patch for it, I’ll be happy to include it.

See ya!On Mon, Sep 13, 2010 at 5:57 AM, Donny Viszneki <donny.viszneki at gmail.com>wrote:

I believe this came up in discussion on the mailing list when these
features were first included. I guess if someone wrote a patch, it would be
included…

On Wed, Sep 8, 2010 at 1:19 PM, Park <kyle_park0 at hotmail.com> wrote:

When I finally decided to upgrade to SDL 1.3, I was surprised to find
that Negative blending is not present while
Additive blending is. Where the algorithm for add blending would be…

Code:

dst = min(dst + (src * A), 255)

the algorithm for negative blending would be…

Code:

dst = max(dst - (src * A), 0)

In such a simple representation, it doesn’t seem that negative blending
would be all that difficult to include in the
form that additive blending is now, although if it is not supported by
hardware the way additive is then that could
be a problem.

Is there an easy way for such a thing to be implemented? Is there a
workaround that people have
found that can implement such a feature with 1.3 as-is?

Thanks.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC