Additive Blending in SDL?
I'm thinking of using SDL's blting functions (no OpenGL) for a game, but there's one feature I can't seem to find information on: additive blending, i.e. doing an alpha op where a pixel with RGB(5,5,5) superimposed on a pixel (100,100,100) gives a pixel (105,105,105). Does this feature exist in sdl itself, or do I need to go to OpenGL? If it does exist, can anyone tell me how to do it?
technically, blending is done by multiplying the pixels. You can do this pixel by pixel using SDL_mapRBGA, or affecting the whole surface by calling SDL_SetAlpha.
You could go in and do the additive thing by hand... you would get some really wierd looking sprites though.
You could go in and do the additive thing by hand... you would get some really wierd looking sprites though.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
SDL is a simple 2D api and that sort of capability isn't included as far as I know. Blending is a slow operation anyway so you should really consider moving to OpenGL for your graphics if speed is an issue.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement