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