2018-04-08 12:17:35 -07:00
|
|
|
using OpenTK.Graphics.OpenGL;
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Gal.OpenGL
|
|
|
|
{
|
2018-06-23 17:39:25 -07:00
|
|
|
public class OGLBlend : IGalBlend
|
2018-04-08 12:17:35 -07: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 14:10:19 -07:00
|
|
|
OGLEnumConverter.GetBlendFactor(FuncSrc),
|
|
|
|
OGLEnumConverter.GetBlendFactor(FuncDst));
|
2018-04-08 12:17:35 -07: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 14:10:19 -07:00
|
|
|
(BlendingFactorSrc)OGLEnumConverter.GetBlendFactor(FuncSrcRgb),
|
|
|
|
(BlendingFactorDest)OGLEnumConverter.GetBlendFactor(FuncDstRgb),
|
|
|
|
(BlendingFactorSrc)OGLEnumConverter.GetBlendFactor(FuncSrcAlpha),
|
|
|
|
(BlendingFactorDest)OGLEnumConverter.GetBlendFactor(FuncDstAlpha));
|
2018-04-08 12:17:35 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|