GRAPHICS: Add boolean flag to Shader::use

This commit is contained in:
Dries Harnie 2013-11-20 01:02:44 +01:00
parent a768689fbe
commit 132508b683
2 changed files with 3 additions and 3 deletions

View File

@ -130,9 +130,9 @@ Shader *Shader::fromFiles(const char *vertex, const char *fragment, const char *
return new Shader(name, vertexShader, fragmentShader, attributes);
}
void Shader::use() {
void Shader::use(bool forceReload) {
static Shader *previousShader = NULL;
if (this == previousShader)
if (this == previousShader && !forceReload)
return;
previousShader = this;

View File

@ -64,7 +64,7 @@ public:
return new Shader(*this);
}
void use();
void use(bool forceReload = false);
void setUniform(const char *uniform, const Math::Matrix4 &m) {
GLint pos = getUniformLocation(uniform);