diff --git a/source/hud/BlockCursor.cpp b/source/hud/BlockCursor.cpp index c89b88ca..43ad8c22 100644 --- a/source/hud/BlockCursor.cpp +++ b/source/hud/BlockCursor.cpp @@ -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); diff --git a/source/hud/HUD.cpp b/source/hud/HUD.cpp index 64644441..d68dbcce 100644 --- a/source/hud/HUD.cpp +++ b/source/hud/HUD.cpp @@ -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; diff --git a/source/states/GameState.cpp b/source/states/GameState.cpp index 37ba471f..feb71c0d 100644 --- a/source/states/GameState.cpp +++ b/source/states/GameState.cpp @@ -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); }