Show error message everytime a shader uniform's location can't be found.
Adjusted code style (TankOs). Original commit message by the author: Show only 1 once the message "Parameter not found" Conflicts: src/SFML/Graphics/Shader.cpp
This commit is contained in:
parent
228038fa8a
commit
0124ad0a85
@ -601,17 +601,11 @@ int Shader::getParamLocation(const std::string& name)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Not in cache, request the location from OpenGL
|
// Not in cache, request the location from OpenGL
|
||||||
int location = glCheck(glGetUniformLocationARB(m_shaderProgram, name.c_str()));
|
int location = glGetUniformLocationARB(m_shaderProgram, name.c_str());
|
||||||
if (location != -1)
|
|
||||||
{
|
|
||||||
// Location found: add it to the cache
|
|
||||||
m_params.insert(std::make_pair(name, location));
|
m_params.insert(std::make_pair(name, location));
|
||||||
}
|
|
||||||
else
|
if (location == -1)
|
||||||
{
|
|
||||||
// Error: location not found
|
|
||||||
err() << "Parameter \"" << name << "\" not found in shader" << std::endl;
|
err() << "Parameter \"" << name << "\" not found in shader" << std::endl;
|
||||||
}
|
|
||||||
|
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user