Show bed numbers when the camera is below the bed

This commit is contained in:
Enrico Turri 2025-01-27 12:22:52 +01:00 committed by Lukas Matena
parent f8dc44d12c
commit 32b5cfb1f5

View File

@ -171,7 +171,9 @@ void Bed3D::render(GLCanvas3D& canvas, const Transform3d& view_matrix, const Tra
shader->set_uniform("projection_matrix", projection_matrix);
glsafe(::glEnable(GL_BLEND));
glsafe(::glEnable(GL_DEPTH_TEST));
glsafe(glDepthMask(GL_FALSE));
glsafe(::glDepthMask(GL_FALSE));
const bool old_cullface = ::glIsEnabled(GL_CULL_FACE);
glsafe(::glDisable(GL_CULL_FACE));
glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
glsafe(::glBindTexture(GL_TEXTURE_2D, m_digits_texture->get_id()));
@ -195,7 +197,9 @@ void Bed3D::render(GLCanvas3D& canvas, const Transform3d& view_matrix, const Tra
m_digits_models[i + 1]->render();
}
glsafe(::glBindTexture(GL_TEXTURE_2D, 0));
glsafe(glDepthMask(GL_TRUE));
if (old_cullface)
glsafe(::glEnable(GL_CULL_FACE));
glsafe(::glDepthMask(GL_TRUE));
glsafe(::glDisable(GL_DEPTH_TEST));
shader->stop_using();
}