Browse Source

Don't yell at people.

Also minor cleanup and string copy optimization.
pull/132/head
Vladimír Vondruš 10 years ago
parent
commit
c463526feb
  1. 4
      src/Magnum/AbstractShaderProgram.cpp
  2. 10
      src/Magnum/Test/AbstractShaderProgramGLTest.cpp

4
src/Magnum/AbstractShaderProgram.cpp

@ -395,9 +395,9 @@ bool AbstractShaderProgram::link(std::initializer_list<std::reference_wrapper<Ab
}
Int AbstractShaderProgram::uniformLocationInternal(const Containers::ArrayView<const char> name) {
GLint location = glGetUniformLocation(_id, name);
const GLint location = glGetUniformLocation(_id, name);
if(location == -1)
Warning() << "AbstractShaderProgram: location of uniform \'" + std::string{name, name.size()} + "\' cannot be retrieved!";
Warning() << "AbstractShaderProgram: location of uniform \'" << Debug::nospace << std::string{name, name.size()} << Debug::nospace << "\' cannot be retrieved";
return location;
}

10
src/Magnum/Test/AbstractShaderProgramGLTest.cpp

@ -51,7 +51,7 @@ struct AbstractShaderProgramGLTest: AbstractOpenGLTester {
void createMultipleOutputsIndexed();
#endif
void uniformLocationOptimizedOut();
void uniformNotFound();
void uniform();
void uniformVector();
void uniformMatrix();
@ -71,7 +71,7 @@ AbstractShaderProgramGLTest::AbstractShaderProgramGLTest() {
&AbstractShaderProgramGLTest::createMultipleOutputsIndexed,
#endif
&AbstractShaderProgramGLTest::uniformLocationOptimizedOut,
&AbstractShaderProgramGLTest::uniformNotFound,
&AbstractShaderProgramGLTest::uniform,
&AbstractShaderProgramGLTest::uniformVector,
&AbstractShaderProgramGLTest::uniformMatrix,
@ -320,7 +320,7 @@ void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() {
}
#endif
void AbstractShaderProgramGLTest::uniformLocationOptimizedOut() {
void AbstractShaderProgramGLTest::uniformNotFound() {
MyPublicShader program;
#ifndef MAGNUM_TARGET_GLES
@ -361,8 +361,8 @@ void AbstractShaderProgramGLTest::uniformLocationOptimizedOut() {
program.uniformLocation("nonexistent");
program.uniformLocation(std::string{"another"});
CORRADE_COMPARE(out.str(),
"AbstractShaderProgram: location of uniform 'nonexistent' cannot be retrieved!\n"
"AbstractShaderProgram: location of uniform 'another' cannot be retrieved!\n");
"AbstractShaderProgram: location of uniform 'nonexistent' cannot be retrieved\n"
"AbstractShaderProgram: location of uniform 'another' cannot be retrieved\n");
}
namespace {

Loading…
Cancel
Save