Add three additional blending modes.

This commit is contained in:
Zimmermann Gyula
2020-02-23 17:20:09 +01:00
committed by reaperrr
parent 1e64048956
commit 8b7e72b95e
2 changed files with 19 additions and 1 deletions

View File

@@ -32,7 +32,10 @@ namespace OpenRA
Subtractive,
Multiply,
Multiplicative,
DoubleMultiplicative
DoubleMultiplicative,
LowAdditive,
Screen,
Translucent
}
public interface IPlatformWindow : IDisposable

View File

@@ -226,6 +226,21 @@ namespace OpenRA.Platforms.Default
OpenGL.CheckGLError();
OpenGL.glBlendFunc(OpenGL.GL_DST_COLOR, OpenGL.GL_SRC_COLOR);
break;
case BlendMode.LowAdditive:
OpenGL.glEnable(OpenGL.GL_BLEND);
OpenGL.CheckGLError();
OpenGL.glBlendFunc(OpenGL.GL_DST_COLOR, OpenGL.GL_ONE);
break;
case BlendMode.Screen:
OpenGL.glEnable(OpenGL.GL_BLEND);
OpenGL.CheckGLError();
OpenGL.glBlendFunc(OpenGL.GL_SRC_COLOR, OpenGL.GL_ONE_MINUS_SRC_COLOR);
break;
case BlendMode.Translucent:
OpenGL.glEnable(OpenGL.GL_BLEND);
OpenGL.CheckGLError();
OpenGL.glBlendFunc(OpenGL.GL_DST_COLOR, OpenGL.GL_ONE_MINUS_DST_COLOR);
break;
}
OpenGL.CheckGLError();