Return the location of a uniform variable inside a shader program
| 158 | |
| 159 | // Return the location of a uniform variable inside a shader program |
| 160 | inline GLint Shader::getUniformLocation(const std::string& variableName, bool errorIfMissing) const { |
| 161 | assert(mProgramObjectID != 0); |
| 162 | GLint location = glGetUniformLocation(mProgramObjectID, variableName.c_str()); |
| 163 | if (location == -1 && errorIfMissing) { |
| 164 | std::cerr << "Error in vertex shader " << mFilenameVertexShader << " or in fragment shader" |
| 165 | << mFilenameFragmentShader << " : No Uniform variable : " << variableName |
| 166 | << std::endl; |
| 167 | //throw std::logic_error("Error in Shader"); |
| 168 | } |
| 169 | |
| 170 | return location; |
| 171 | } |
| 172 | |
| 173 | // Return the location of an attribute variable inside a shader program |
| 174 | inline GLint Shader::getAttribLocation(const std::string& variableName, bool errorIfMissing) const { |
nothing calls this directly
no outgoing calls
no test coverage detected