Adds two new BlendModes.
This commit is contained in:
@@ -34,7 +34,18 @@ namespace OpenRA
|
|||||||
|
|
||||||
public interface IHardwareCursor : IDisposable { }
|
public interface IHardwareCursor : IDisposable { }
|
||||||
|
|
||||||
public enum BlendMode : byte { None, Alpha, Additive, Subtractive, Multiply }
|
public enum BlendMode : byte
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
Alpha,
|
||||||
|
Additive,
|
||||||
|
Subtractive,
|
||||||
|
Multiply,
|
||||||
|
SoftAdditive,
|
||||||
|
Translucency25,
|
||||||
|
Translucency50,
|
||||||
|
Translucency75
|
||||||
|
}
|
||||||
|
|
||||||
public interface IGraphicsDevice : IDisposable
|
public interface IGraphicsDevice : IDisposable
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -241,6 +241,32 @@ namespace OpenRA.Renderer.Sdl2
|
|||||||
GL.BlendFuncSeparate(BlendingFactorSrc.DstColor, BlendingFactorDest.Zero, BlendingFactorSrc.One, BlendingFactorDest.OneMinusSrcAlpha);
|
GL.BlendFuncSeparate(BlendingFactorSrc.DstColor, BlendingFactorDest.Zero, BlendingFactorSrc.One, BlendingFactorDest.OneMinusSrcAlpha);
|
||||||
ErrorHandler.CheckGlError();
|
ErrorHandler.CheckGlError();
|
||||||
break;
|
break;
|
||||||
|
case BlendMode.SoftAdditive:
|
||||||
|
GL.Enable(EnableCap.Blend);
|
||||||
|
ErrorHandler.CheckGlError();
|
||||||
|
GL.BlendFunc(BlendingFactorSrc.OneMinusDstColor, BlendingFactorDest.One);
|
||||||
|
break;
|
||||||
|
case BlendMode.Translucency25:
|
||||||
|
GL.Enable(EnableCap.Blend);
|
||||||
|
ErrorHandler.CheckGlError();
|
||||||
|
GL.BlendFunc(BlendingFactorSrc.OneMinusConstantAlpha, BlendingFactorDest.One);
|
||||||
|
ErrorHandler.CheckGlError();
|
||||||
|
GL.BlendColor(1f, 1f, 1f, 0.25f);
|
||||||
|
break;
|
||||||
|
case BlendMode.Translucency50:
|
||||||
|
GL.Enable(EnableCap.Blend);
|
||||||
|
ErrorHandler.CheckGlError();
|
||||||
|
GL.BlendFunc(BlendingFactorSrc.OneMinusConstantAlpha, BlendingFactorDest.One);
|
||||||
|
ErrorHandler.CheckGlError();
|
||||||
|
GL.BlendColor(1f, 1f, 1f, 0.5f);
|
||||||
|
break;
|
||||||
|
case BlendMode.Translucency75:
|
||||||
|
GL.Enable(EnableCap.Blend);
|
||||||
|
ErrorHandler.CheckGlError();
|
||||||
|
GL.BlendFunc(BlendingFactorSrc.OneMinusConstantAlpha, BlendingFactorDest.One);
|
||||||
|
ErrorHandler.CheckGlError();
|
||||||
|
GL.BlendColor(1f, 1f, 1f, 0.75f);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorHandler.CheckGlError();
|
ErrorHandler.CheckGlError();
|
||||||
|
|||||||
Reference in New Issue
Block a user