added check for uniform location in glw program.

This commit is contained in:
Marco Di Benedetto 2012-06-02 00:35:04 +00:00
parent f89f762216
commit bff5f97fe6
1 changed files with 3 additions and 1 deletions

View File

@ -243,7 +243,9 @@ class Program : public Object
#if GLW_ASSERT_UNIFORM_LOCATION #if GLW_ASSERT_UNIFORM_LOCATION
GLW_ASSERT(this->m_uniforms.count(name) > 0); GLW_ASSERT(this->m_uniforms.count(name) > 0);
#endif #endif
return this->m_uniforms.find(name)->second.location; UniformMapConstIterator it = this->m_uniforms.find(name);
if (it == this->m_uniforms.end()) return -1;
return it->second.location;
} }
#define _GLW_IMPLEMENT_SCALAR_UNIFORM_(TYPE, FUNCION_SUFFIX) \ #define _GLW_IMPLEMENT_SCALAR_UNIFORM_(TYPE, FUNCION_SUFFIX) \