Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd Alpha Blitter #420
Closed
Add Alpha Blitter #420
Labels
Comments
|
I do not know much about making games. But I know that you can draw a 2D game using OpenGL. Then you have hardware acceleration for everything. I really like your game! |
|
SDL_gfxBlitFunc.h and .c added. This is from SDL_gfx, written by Andreas Schiffler and released under the ZLIB license (GPL compatible). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are only a couple places we want to merge two fully Alpha-transparent surfaces before drawing the result to screen. SDL doesn't handle this by default (it uses the alpha channel of the source or destination, not both).
We mainly use this when we composite the hero sprite layers (during gameplay and on the loading screen).
So currently we use color key transparency (magic pink), which makes the character outline aliased. It's not pretty.
SDL_gfx has a custom (not hardware accelerated) method to combine alpha surfaces the way we want.
Instead of adding the entire SDL_gfx library as a dependency, I'm thinking we can just grab the SDL_gfxBlitFunc.c (and matching .h) and add it to Flare.
http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_blit_func_8c.html#ac51ff40d39f3dd0bd08116e8953960f8
It's slow, but it's something we only use rarely -- during a single frame's logic() update after the hero is loaded or changes equipment.