From 09335d17ba0412adb03a966c4af686fe20555110 Mon Sep 17 00:00:00 2001 From: dibenedetto Date: Sat, 19 May 2012 17:59:50 +0000 Subject: [PATCH] added preprocessor macro in glw config to disable assertion on not existing program uniforms. --- wrap/glw/config.h | 4 ++++ wrap/glw/program.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/wrap/glw/config.h b/wrap/glw/config.h index 011be09c..6d3d29a9 100644 --- a/wrap/glw/config.h +++ b/wrap/glw/config.h @@ -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 diff --git a/wrap/glw/program.h b/wrap/glw/program.h index da2b525d..09895449 100644 --- a/wrap/glw/program.h +++ b/wrap/glw/program.h @@ -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; }