diff --git a/src/etc.h b/src/etc.h index 202dd9d..3e17acf 100644 --- a/src/etc.h +++ b/src/etc.h @@ -31,6 +31,8 @@ struct SDL_Color; enum BlendType { + BlendKeepDestAlpha = -1, + BlendNormal = 0, BlendAddition = 1, BlendSubstraction = 2 diff --git a/src/glstate.cpp b/src/glstate.cpp index 613b55e..8c3a2a4 100644 --- a/src/glstate.cpp +++ b/src/glstate.cpp @@ -64,6 +64,12 @@ void GLBlendMode::apply(const BlendType &value) { switch (value) { + case BlendKeepDestAlpha : + gl.BlendEquation(GL_FUNC_ADD); + gl.BlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, + GL_ZERO, GL_ONE); + break; + case BlendNormal : gl.BlendEquation(GL_FUNC_ADD); gl.BlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,