Skip to content

Commit

Permalink
libgui|GL: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 4cf4d67 commit dee33e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion doomsday/libs/gui/src/graphics/glprogram.cpp
Expand Up @@ -221,15 +221,21 @@ DENG2_PIMPL(GLProgram)

if (texturesChanged)
{
auto &GL = LIBGUI_GL;
// Update the sampler uniforms.
for (int unit = 0; unit < textures.size(); ++unit)
{
int loc = self().glUniformLocation(textures[unit]->name());
if (loc >= 0)
{
LIBGUI_GL.glUniform1i(loc, unit);
// qDebug() << "[GLProgram] texture" << textures[unit]->name() << loc << unit;
GL.glUniform1i(loc, unit);
LIBGUI_ASSERT_GL_OK();
}
// else
// {
// qDebug() << "[GLProgram] texture" << textures[unit]->name() << "no location!";
// }
}
texturesChanged = false;
}
Expand Down
3 changes: 2 additions & 1 deletion doomsday/libs/gui/src/graphics/glshader.cpp
Expand Up @@ -222,7 +222,8 @@ void GLShader::compile(Type shaderType, IByteArray const &shaderSource)
LIBGUI_GL.glGetShaderInfoLog(d->name, logSize, &count, reinterpret_cast<GLchar *>(log.data()));

throw CompilerError("GLShader::compile",
"Compilation of " + String(d->type == Fragment? "fragment" : "vertex") +
"Compilation of " + String(d->type == Fragment? "fragment" :
d->type == Geometry? "geometry" : "vertex") +
" shader failed:\n" + log);
}

Expand Down

0 comments on commit dee33e1

Please sign in to comment.