Move simple UI blend mapping to renderer gl
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "pch.h"
|
||||
#include "log.h"
|
||||
#include "node_border.h"
|
||||
#include "renderer_gl/opengl_capabilities.h"
|
||||
#include "shader.h"
|
||||
|
||||
Plane NodeBorder::m_plane;
|
||||
@@ -62,21 +63,22 @@ void NodeBorder::draw()
|
||||
{
|
||||
ShaderManager::use(kShader::Color);
|
||||
ShaderManager::u_mat4(kShaderUniform::MVP, m_mvp);
|
||||
const auto blend_state = pp::renderer::gl::blend_state();
|
||||
|
||||
if (m_color.a > 0.f)
|
||||
{
|
||||
m_color.a < 1.f ? glEnable(GL_BLEND) : glDisable(GL_BLEND);
|
||||
m_color.a < 1.f ? glEnable(blend_state) : glDisable(blend_state);
|
||||
ShaderManager::u_vec4(kShaderUniform::Col, m_color);
|
||||
m_plane.draw_fill();
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(blend_state);
|
||||
}
|
||||
|
||||
if (m_thinkness > 0 && m_border_color.a > 0.f)
|
||||
{
|
||||
//glLineWidth(m_thinkness);
|
||||
ShaderManager::u_vec4(kShaderUniform::Col, m_border_color);
|
||||
m_border_color.a < 1.f ? glEnable(GL_BLEND) : glDisable(GL_BLEND);
|
||||
m_border_color.a < 1.f ? glEnable(blend_state) : glDisable(blend_state);
|
||||
m_plane.draw_stroke();
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(blend_state);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user