added check for uniform location in glw program.
This commit is contained in:
parent
f89f762216
commit
bff5f97fe6
|
@ -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) \
|
||||||
|
|
Loading…
Reference in New Issue