added preprocessor macro in glw config to disable assertion on not existing program uniforms.

This commit is contained in:
Marco Di Benedetto 2012-05-19 17:59:50 +00:00
parent 754ba0c94f
commit 09335d17ba
2 changed files with 6 additions and 0 deletions

View File

@ -13,4 +13,8 @@
# define GLW_PRINT_LOG_TO_STDERR 1
#endif
#ifndef GLW_ASSERT_UNIFORM_LOCATION
# define GLW_ASSERT_UNIFORM_LOCATION 0
#endif
#endif // GLW_CONFIG_H

View File

@ -235,7 +235,9 @@ class Program : public Object
GLint getUniformLocation(const std::string & name) const
{
#if GLW_ASSERT_UNIFORM_LOCATION
GLW_ASSERT(this->m_uniforms.count(name) > 0);
#endif
return this->m_uniforms.find(name)->second.location;
}