SDL and Additive Blending

Started by
4 comments, last by PnP Bios 19 years, 6 months ago
I'd like to use SDL (without OpenGL, just the 2D library) for a game. The one thing is, though, I'd really like to use Additive Blending for explosions and such. If I were to do this myself, fiddling with the buffer as sdl allows, would it be too slow, or would I be able to squeak by? I like the SDL 2D library, and I'd prefer not to have to switch to using SDL just as a wrapper for OpenGL just so I can use one feature...
Advertisement
It would only be slow if you did the alpha in realtime. what you can do, is build alpha masks, or use TGA images which support an alpha channel.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
Even using alpha channels on the sprites is likely to be too slow unless you run with all surfaces in software at a low resolution. Write a simple test case first to see if it'll meet your speed requirements.
Quote:Original post by PnP Bios
It would only be slow if you did the alpha in realtime. what you can do, is build alpha masks, or use TGA images which support an alpha channel.


Does sdl have support for that kind of alpha channel usage? I've looked at your tutorial listings, and I saw something on doing transparency (and color keying of course) but I didn't see anything on additive alpha...
SDL supports both per-surface alpha and per-pixel alpha, although the documentation does not do a good job of explaining the differences and limitations of each method.
Quote:Original post by Anonymous Poster
Quote:Original post by PnP Bios
It would only be slow if you did the alpha in realtime. what you can do, is build alpha masks, or use TGA images which support an alpha channel.


Does sdl have support for that kind of alpha channel usage? I've looked at your tutorial listings, and I saw something on doing transparency (and color keying of course) but I didn't see anything on additive alpha...


The only thing you do different is use MapRGBA, instead of MAPRGB. I'm going to have to put that in somewhere...

Thanks
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One

This topic is closed to new replies.

Advertisement