Add internal 'KeepDestAlpha' BlendType (for use in WindowVX)

This commit is contained in:
Jonas Kulla 2014-08-12 21:28:18 +02:00
parent d95e90db34
commit d654fb7dd6
2 changed files with 8 additions and 0 deletions

View File

@ -31,6 +31,8 @@ struct SDL_Color;
enum BlendType enum BlendType
{ {
BlendKeepDestAlpha = -1,
BlendNormal = 0, BlendNormal = 0,
BlendAddition = 1, BlendAddition = 1,
BlendSubstraction = 2 BlendSubstraction = 2

View File

@ -64,6 +64,12 @@ void GLBlendMode::apply(const BlendType &value)
{ {
switch (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 : case BlendNormal :
gl.BlendEquation(GL_FUNC_ADD); gl.BlendEquation(GL_FUNC_ADD);
gl.BlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, gl.BlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,