427a764: subtractive blend (OpenGL only for now) [Glenn Maynard]

I was looking into writing the equivalent Direct3D code; still not 100% sure if my code is right, so it stays local for now.
This commit is contained in:
AJ Kelly
2010-02-08 01:32:14 -06:00
parent c0d0269549
commit 2d872ac518
3 changed files with 7 additions and 0 deletions
+5
View File
@@ -1715,6 +1715,8 @@ void RageDisplay_OGL::SetBlendMode( BlendMode mode )
{
if( mode == BLEND_INVERT_DEST )
GLExt.glBlendEquation( GL_FUNC_SUBTRACT );
else if( mode == BLEND_SUBTRACT )
GLExt.glBlendEquation( GL_FUNC_REVERSE_SUBTRACT );
else
GLExt.glBlendEquation( GL_FUNC_ADD );
}
@@ -1729,6 +1731,9 @@ void RageDisplay_OGL::SetBlendMode( BlendMode mode )
case BLEND_ADD:
iSourceRGB = GL_SRC_ALPHA; iDestRGB = GL_ONE;
break;
case BLEND_SUBTRACT:
iSourceRGB = GL_SRC_ALPHA; iDestRGB = GL_ONE_MINUS_SRC_ALPHA;
break;
case BLEND_MODULATE:
iSourceRGB = GL_ZERO; iDestRGB = GL_SRC_COLOR;
break;