1
1
#include " Filters.hpp"
2
2
3
+ #include < Renderer/BlendMode.hpp>
4
+
5
+ using libprojectM::Renderer::BlendMode;
6
+
3
7
namespace libprojectM {
4
8
namespace MilkdropPreset {
5
9
@@ -20,7 +24,7 @@ void Filters::Draw()
20
24
return ;
21
25
}
22
26
23
- glEnable (GL_BLEND );
27
+ BlendMode::SetBlendActive ( true );
24
28
25
29
auto shader = m_presetState.untexturedShader .lock ();
26
30
shader->Bind ();
@@ -48,37 +52,37 @@ void Filters::Draw()
48
52
Renderer::Mesh::Unbind ();
49
53
Renderer::Shader::Unbind ();
50
54
51
- glDisable (GL_BLEND );
55
+ BlendMode::SetBlendActive ( false );
52
56
}
53
57
54
58
55
59
void Filters::Brighten ()
56
60
{
57
- glBlendFunc (GL_ONE_MINUS_DST_COLOR, GL_ZERO );
61
+ BlendMode::SetBlendFunction (BlendMode::Function::OneMinusDestinationColor, BlendMode::Function::Zero );
58
62
m_filterMesh.Draw ();
59
- glBlendFunc (GL_ZERO, GL_DST_COLOR );
63
+ BlendMode::SetBlendFunction (BlendMode::Function::Zero, BlendMode::Function::DestinationColor );
60
64
m_filterMesh.Draw ();
61
- glBlendFunc (GL_ONE_MINUS_DST_COLOR, GL_ZERO );
65
+ BlendMode::SetBlendFunction (BlendMode::Function::OneMinusDestinationColor, BlendMode::Function::Zero );
62
66
m_filterMesh.Draw ();
63
67
}
64
68
65
69
void Filters::Darken ()
66
70
{
67
- glBlendFunc (GL_ZERO, GL_DST_COLOR );
71
+ BlendMode::SetBlendFunction (BlendMode::Function::Zero, BlendMode::Function::DestinationColor );
68
72
m_filterMesh.Draw ();
69
73
}
70
74
71
75
void Filters::Solarize ()
72
76
{
73
- glBlendFunc (GL_ZERO, GL_ONE_MINUS_DST_COLOR );
77
+ BlendMode::SetBlendFunction (BlendMode::Function::Zero, BlendMode::Function::OneMinusDestinationColor );
74
78
m_filterMesh.Draw ();
75
- glBlendFunc (GL_DST_COLOR, GL_ONE );
79
+ BlendMode::SetBlendFunction (BlendMode::Function::DestinationColor, BlendMode::Function::One );
76
80
m_filterMesh.Draw ();
77
81
}
78
82
79
83
void Filters::Invert ()
80
84
{
81
- glBlendFunc (GL_ONE_MINUS_DST_COLOR, GL_ZERO );
85
+ BlendMode::SetBlendFunction (BlendMode::Function::OneMinusDestinationColor, BlendMode::Function::Zero );
82
86
m_filterMesh.Draw ();
83
87
}
84
88
0 commit comments