added preprocessor macro in glw config to disable assertion on not existing program uniforms.
This commit is contained in:
parent
754ba0c94f
commit
09335d17ba
|
@ -13,4 +13,8 @@
|
||||||
# define GLW_PRINT_LOG_TO_STDERR 1
|
# define GLW_PRINT_LOG_TO_STDERR 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef GLW_ASSERT_UNIFORM_LOCATION
|
||||||
|
# define GLW_ASSERT_UNIFORM_LOCATION 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // GLW_CONFIG_H
|
#endif // GLW_CONFIG_H
|
||||||
|
|
|
@ -235,7 +235,9 @@ class Program : public Object
|
||||||
|
|
||||||
GLint getUniformLocation(const std::string & name) const
|
GLint getUniformLocation(const std::string & name) const
|
||||||
{
|
{
|
||||||
|
#if GLW_ASSERT_UNIFORM_LOCATION
|
||||||
GLW_ASSERT(this->m_uniforms.count(name) > 0);
|
GLW_ASSERT(this->m_uniforms.count(name) > 0);
|
||||||
|
#endif
|
||||||
return this->m_uniforms.find(name)->second.location;
|
return this->m_uniforms.find(name)->second.location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue