[BlockCursor] Rendering fixed.

This commit is contained in:
Quentin Bazin 2019-01-06 22:31:02 +01:00
parent f32f740b0d
commit ac4c628009
3 changed files with 3 additions and 3 deletions

View File

@ -224,7 +224,7 @@ void BlockCursor::draw(gk::RenderTarget &target, gk::RenderStates states) const
glDisable(GL_POLYGON_OFFSET_FILL);
glDisable(GL_CULL_FACE);
states.transform = glm::translate(glm::mat4{1}, glm::vec3{m_selectedBlock});
states.transform.translate({m_selectedBlock.x, m_selectedBlock.y, m_selectedBlock.z});
target.draw(m_vbo, GL_LINES, 0, 24, states);

View File

@ -58,6 +58,8 @@ void HUD::update() {
void HUD::draw(gk::RenderTarget &target, gk::RenderStates states) const {
target.draw(m_blockCursor, states);
target.disableView();
states.shader = &m_shader;
states.projectionMatrix = m_orthoMatrix;
states.viewMatrix = gk::Transform::Identity;

View File

@ -110,8 +110,6 @@ void GameState::draw(gk::RenderTarget &target, gk::RenderStates states) const {
target.setView(m_camera);
target.draw(m_world, states);
target.disableView();
target.draw(m_hud, states);
}