2018-04-08 15:17:35 -04:00
|
|
|
using OpenTK.Graphics.OpenGL;
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Gal.OpenGL
|
|
|
|
{
|
2018-06-23 20:39:25 -04:00
|
|
|
public class OGLBlend : IGalBlend
|
2018-04-08 15:17:35 -04:00
|
|
|
{
|
|
|
|
public void Enable()
|
|
|
|
{
|
|
|
|
GL.Enable(EnableCap.Blend);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Disable()
|
|
|
|
{
|
|
|
|
GL.Disable(EnableCap.Blend);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Set(
|
|
|
|
GalBlendEquation Equation,
|
|
|
|
GalBlendFactor FuncSrc,
|
|
|
|
GalBlendFactor FuncDst)
|
|
|
|
{
|
|
|
|
GL.BlendEquation(
|
|
|
|
OGLEnumConverter.GetBlendEquation(Equation));
|
|
|
|
|
|
|
|
GL.BlendFunc(
|
2018-06-21 17:10:19 -04:00
|
|
|
OGLEnumConverter.GetBlendFactor(FuncSrc),
|
|
|
|
OGLEnumConverter.GetBlendFactor(FuncDst));
|
2018-04-08 15:17:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void SetSeparate(
|
|
|
|
GalBlendEquation EquationRgb,
|
|
|
|
GalBlendEquation EquationAlpha,
|
|
|
|
GalBlendFactor FuncSrcRgb,
|
|
|
|
GalBlendFactor FuncDstRgb,
|
|
|
|
GalBlendFactor FuncSrcAlpha,
|
|
|
|
GalBlendFactor FuncDstAlpha)
|
|
|
|
{
|
|
|
|
GL.BlendEquationSeparate(
|
|
|
|
OGLEnumConverter.GetBlendEquation(EquationRgb),
|
|
|
|
OGLEnumConverter.GetBlendEquation(EquationAlpha));
|
|
|
|
|
|
|
|
GL.BlendFuncSeparate(
|
2018-06-21 17:10:19 -04:00
|
|
|
(BlendingFactorSrc)OGLEnumConverter.GetBlendFactor(FuncSrcRgb),
|
|
|
|
(BlendingFactorDest)OGLEnumConverter.GetBlendFactor(FuncDstRgb),
|
|
|
|
(BlendingFactorSrc)OGLEnumConverter.GetBlendFactor(FuncSrcAlpha),
|
|
|
|
(BlendingFactorDest)OGLEnumConverter.GetBlendFactor(FuncDstAlpha));
|
2018-04-08 15:17:35 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|