MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / getUniformLocation

Method getUniformLocation

testbed/opengl-framework/src/Shader.h:160–171  ·  view source on GitHub ↗

Return the location of a uniform variable inside a shader program

Source from the content-addressed store, hash-verified

158
159// Return the location of a uniform variable inside a shader program
160inline 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
174inline GLint Shader::getAttribLocation(const std::string& variableName, bool errorIfMissing) const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected