Skip to content

Commit

Permalink
Fixed|Renderer: Reset GL state to defaults after rendering a model
Browse files Browse the repository at this point in the history
Todo: GL state should be managed via GLState to avoid this kind
of problems.
  • Loading branch information
skyjake committed Dec 21, 2015
1 parent c05904d commit 4b54789
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions doomsday/apps/client/src/render/modelrenderer.cpp
Expand Up @@ -746,8 +746,13 @@ void ModelRenderer::render(vissprite_t const &spr)
d->draw(p);
GLState::pop();

/// @todo Something is interfering with the cull setting elsewhere (remove this).
GLState::current().setCull(gl::Back).apply();
/// @todo Something is interfering with the GL state elsewhere (remove this).
GLState::current()
.setCull(gl::Back)
.setDepthTest(true)
.setDepthFunc(gl::Less)
.setDepthWrite(true)
.apply();
}

void ModelRenderer::render(vispsprite_t const &pspr)
Expand All @@ -771,8 +776,13 @@ void ModelRenderer::render(vispsprite_t const &pspr)
d->draw(p);
GLState::pop();

/// @todo Something is interfering with the cull setting elsewhere (remove this).
GLState::current().setCull(gl::Back).apply();
/// @todo Something is interfering with the GL state elsewhere (remove this).
GLState::current()
.setCull(gl::Back)
.setDepthTest(true)
.setDepthFunc(gl::Less)
.setDepthWrite(true)
.apply();
}

String ModelRenderer::shaderName(GLProgram const &program) const
Expand Down

0 comments on commit 4b54789

Please sign in to comment.