2018-04-08 19:17:35 +00:00
|
|
|
using OpenTK.Graphics.OpenGL;
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Gal.OpenGL
|
|
|
|
{
|
|
|
|
class OGLBlend
|
|
|
|
{
|
|
|
|
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 21:10:19 +00:00
|
|
|
OGLEnumConverter.GetBlendFactor(FuncSrc),
|
|
|
|
OGLEnumConverter.GetBlendFactor(FuncDst));
|
2018-04-08 19:17:35 +00: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 21:10:19 +00:00
|
|
|
(BlendingFactorSrc)OGLEnumConverter.GetBlendFactor(FuncSrcRgb),
|
|
|
|
(BlendingFactorDest)OGLEnumConverter.GetBlendFactor(FuncDstRgb),
|
|
|
|
(BlendingFactorSrc)OGLEnumConverter.GetBlendFactor(FuncSrcAlpha),
|
|
|
|
(BlendingFactorDest)OGLEnumConverter.GetBlendFactor(FuncDstAlpha));
|
2018-04-08 19:17:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|