Browse Source

Fix for shader warning strings with null characters in them

pull/87/head
Bill Robinson 12 years ago
parent
commit
9dcd7c1974
  1. 8
      src/Magnum/AbstractShaderProgram.cpp

8
src/Magnum/AbstractShaderProgram.cpp

@ -391,8 +391,12 @@ bool AbstractShaderProgram::link(std::initializer_list<std::reference_wrapper<Ab
Int AbstractShaderProgram::uniformLocationInternal(const Containers::ArrayReference<const char> name) { Int AbstractShaderProgram::uniformLocationInternal(const Containers::ArrayReference<const char> name) {
GLint location = glGetUniformLocation(_id, name); GLint location = glGetUniformLocation(_id, name);
if(location == -1) if(location == -1) {
Warning() << "AbstractShaderProgram: location of uniform \'" + std::string{name, name.size()} + "\' cannot be retrieved!"; std::string namestr = std::string{name, name.size()};
while (!namestr.empty() && namestr.back() == '\0') namestr.pop_back();
Warning() << "AbstractShaderProgram: location of uniform \'" + namestr + "\' cannot be retrieved!";
}
return location; return location;
} }

Loading…
Cancel
Save