[BlockCursor] Rendering fixed.
This commit is contained in:
parent
f32f740b0d
commit
ac4c628009
@ -224,7 +224,7 @@ void BlockCursor::draw(gk::RenderTarget &target, gk::RenderStates states) const
|
|||||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||||
glDisable(GL_CULL_FACE);
|
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);
|
target.draw(m_vbo, GL_LINES, 0, 24, states);
|
||||||
|
|
||||||
|
@ -58,6 +58,8 @@ void HUD::update() {
|
|||||||
void HUD::draw(gk::RenderTarget &target, gk::RenderStates states) const {
|
void HUD::draw(gk::RenderTarget &target, gk::RenderStates states) const {
|
||||||
target.draw(m_blockCursor, states);
|
target.draw(m_blockCursor, states);
|
||||||
|
|
||||||
|
target.disableView();
|
||||||
|
|
||||||
states.shader = &m_shader;
|
states.shader = &m_shader;
|
||||||
states.projectionMatrix = m_orthoMatrix;
|
states.projectionMatrix = m_orthoMatrix;
|
||||||
states.viewMatrix = gk::Transform::Identity;
|
states.viewMatrix = gk::Transform::Identity;
|
||||||
|
@ -110,8 +110,6 @@ void GameState::draw(gk::RenderTarget &target, gk::RenderStates states) const {
|
|||||||
|
|
||||||
target.setView(m_camera);
|
target.setView(m_camera);
|
||||||
target.draw(m_world, states);
|
target.draw(m_world, states);
|
||||||
target.disableView();
|
|
||||||
|
|
||||||
target.draw(m_hud, states);
|
target.draw(m_hud, states);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user