In fact, lets just replace Shader:getUniformVariable with Shader:hasUniform. The latter returns true if the uniform with the specified name exists and contributes to the final output of the shader.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2016-09-01 18:32:12 -03:00
parent ee79038572
commit 7a904de2e1
3 changed files with 9 additions and 52 deletions
+2 -14
View File
@@ -621,21 +621,9 @@ int Shader::getTextureUnit(const std::string &name)
return texunit;
}
Shader::UniformType Shader::getUniformVariable(const std::string &name, int &components, int &count)
bool Shader::hasUniform(const std::string &name) const
{
auto it = uniforms.find(name);
if (it == uniforms.end())
{
components = 0;
count = 0;
return UNIFORM_UNKNOWN;
}
components = getUniformTypeSize(it->second.type);
count = (int) it->second.count;
return it->second.baseType;
return uniforms.find(name) != uniforms.end();
}
GLint Shader::getAttribLocation(const std::string &name)