Skip to content

Commit

Permalink
Fixed BlockCursor display.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Jun 29, 2020
1 parent e919cbb commit b0aa1ad
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions source/client/graphics/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ void Framebuffer::end() const {
gk::Shader::bind(nullptr);

glActiveTexture(GL_TEXTURE0);

glEnable(GL_DEPTH_TEST);
}

void Framebuffer::bind(const Framebuffer *framebuffer) {
Expand Down
2 changes: 0 additions & 2 deletions source/client/hud/HUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ void HUD::update() {
}

void HUD::draw(gk::RenderTarget &target, gk::RenderStates states) const {
target.draw(m_blockCursor, states);

target.disableView();

states.shader = &m_shader;
Expand Down
2 changes: 2 additions & 0 deletions source/client/hud/HUD.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class HUD : public gk::Transformable, public gk::Drawable {

void update();

const BlockCursor &blockCursor() const { return m_blockCursor; }

Chat &chat() { return m_chat; }

private:
Expand Down
5 changes: 2 additions & 3 deletions source/client/states/GameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,9 @@ void GameState::draw(gk::RenderTarget &target, gk::RenderStates states) const {
if (it.second.dimension() == m_player.dimension())
target.draw(it.second, states);

m_fbo.end();
target.draw(m_hud.blockCursor(), states);

states.shader = &m_shader;
glEnable(GL_DEPTH_TEST);
m_fbo.end();

target.draw(m_hud, states);
}
Expand Down

0 comments on commit b0aa1ad

Please sign in to comment.