Skip to content

Commit

Permalink
Fixed|GLProgram: Allocate OpenGL program object
Browse files Browse the repository at this point in the history
The GL program object was not allocated before shaders were attached
to it.
  • Loading branch information
skyjake committed Apr 27, 2013
1 parent 715532e commit 3903eac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doomsday/libgui/src/glprogram.cpp
Expand Up @@ -23,6 +23,7 @@
#include "de/GLTexture"
#include "de/gui/opengl.h"
#include <de/Block>
#include <de/Log>

#include <QSet>
#include <QList>
Expand Down Expand Up @@ -87,6 +88,7 @@ DENG2_OBSERVES(GLUniform, Deletion)
void attach(GLShader const *shader)
{
DENG2_ASSERT(shader->isReady());
alloc();
glAttachShader(name, shader->glName());
shaders.insert(holdRef(shader));
}
Expand Down Expand Up @@ -343,7 +345,11 @@ GLuint GLProgram::glName() const
int GLProgram::glUniformLocation(char const *uniformName) const
{
GLint loc = glGetUniformLocation(d->name, uniformName);
// Could check loc here for validity.
if(loc < 0)
{
LOG_AS("GLProgram");
LOG_DEBUG("Could not find uniform '%s'") << uniformName;
}
return loc;
}

Expand Down

0 comments on commit 3903eac

Please sign in to comment.