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
+3 -10
View File
@@ -168,17 +168,10 @@ public:
void sendTexture(const std::string &name, Texture *texture);
/**
* Gets the type, number of components, and number of array elements of
* an active uniform variable in the shader. If a uniform variable with the
* specified name doesn't exist, returns UNIFORM_UNKNOWN and sets the
* 'components' and 'count' values to 0.
*
* @param name The name of the uniform variable in the source code.
* @param[out] components Number of components of the variable (2 for vec2.)
* @param[out] count Number of array elements, if the variable is an array.
* @return The base type of the uniform variable.
* Gets whether a uniform with the specified name exists and is actively
* used in the shader.
**/
UniformType getUniformVariable(const std::string &name, int &components, int &count);
bool hasUniform(const std::string &name) const;
GLint getAttribLocation(const std::string &name);