Skip to content

Commit

Permalink
If recompiling currently bound ShaderProgram, unbind it
Browse files Browse the repository at this point in the history
  • Loading branch information
matteblair committed Sep 24, 2014
1 parent f4b1d91 commit 9dcca0e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/util/shaderProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ bool ShaderProgram::buildFromSourceStrings(const std::string& _fragSrc, const st

// New shaders linked successfully, so replace old shaders and program

if (m_glProgram == s_activeGlProgram) {
glUseProgram(0);
s_activeGlProgram = 0;
}

glDeleteShader(m_glFragmentShader);
glDeleteShader(m_glVertexShader);
glDeleteProgram(m_glProgram);
Expand Down

0 comments on commit 9dcca0e

Please sign in to comment.