Ejemplo n.º 1
0
void Program::setUniform(int nLoc, uint32_t type, const vec2& value, bool forced)
{
	if (nLoc == -1) return;
	
	(void)type;
	assert(type == GL_FLOAT_VEC2);
	assert(loaded());
	
	if (forced || ((_vec2Cache.count(nLoc) == 0) || (_vec2Cache[nLoc] != value)))
	{
		_vec2Cache[nLoc] = value;
		glUniform2fv(nLoc, 1, value.data());
	}
	
	checkOpenGLError("setUniform - vec2");
}
Ejemplo n.º 2
0
void Program::setUniform(int nLoc, uint32_t type, const vec2& value, bool forced)
{
#if !defined(ET_CONSOLE_APPLICATION)
	if (nLoc == -1) return;
	
	(void)type;
	ET_ASSERT(type == GL_FLOAT_VEC2);
	ET_ASSERT(apiHandleValid());
	
	if (forced || ((_vec2Cache.count(nLoc) == 0) || (_vec2Cache[nLoc] != value)))
	{
		_vec2Cache[nLoc] = value;
		glUniform2fv(nLoc, 1, value.data());
		checkOpenGLError("glUniform2fv");
	}
	
#endif
}