refactor font loading

This commit is contained in:
2019-12-01 18:24:59 +01:00
parent 0905827b8d
commit c8bce21b95
30 changed files with 180 additions and 84 deletions

View File

@@ -18,8 +18,8 @@ void NodeImageTexture::clone_copy(Node* dest) const
void NodeImageTexture::draw()
{
tex.bind();
auto& sampler = tex.has_mips ? NodeImage::m_sampler_mips : NodeImage::m_sampler;
tex ? tex->bind() : glBindTexture(GL_TEXTURE_2D, 0);
auto& sampler = tex && tex->has_mips ? NodeImage::m_sampler_mips : NodeImage::m_sampler;
sampler.bind(0);
glEnable(GL_BLEND);
ShaderManager::use(kShader::Texture);
@@ -27,6 +27,5 @@ void NodeImageTexture::draw()
ShaderManager::u_mat4(kShaderUniform::MVP, m_mvp);
NodeImage::m_plane.draw_fill();
sampler.unbind();
tex.unbind();
glDisable(GL_BLEND);
}