Moved LightLocations to outside of UniformLocations

dev-time-step
Tomasz Kapuściński 2016-02-15 20:05:25 +01:00
parent 2b94de44a8
commit 79c21f6676
2 changed files with 20 additions and 18 deletions

View File

@ -683,7 +683,7 @@ void CGL21Device::SetLight(int index, const Light &light)
m_lights[index] = light;
UniformLocations::LightLocations &loc = m_uniforms[m_mode].lights[index];
LightLocations &loc = m_uniforms[m_mode].lights[index];
glUniform4fv(loc.ambient, 1, light.ambient.Array());
glUniform4fv(loc.diffuse, 1, light.diffuse.Array());

View File

@ -42,6 +42,24 @@
namespace Gfx
{
struct LightLocations
{
//! true enables light
GLint enabled = -1;
//! Light type
GLint type = -1;
//! Position or direction vector
GLint position = -1;
//! Ambient color
GLint ambient = -1;
//! Diffuse color
GLint diffuse = -1;
//! Specular color
GLint specular = -1;
//! Attenuation
GLint attenuation = -1;
};
struct UniformLocations
{
// Uniforms
@ -91,23 +109,7 @@ struct UniformLocations
//! Specular color
GLint specularColor = -1;
struct LightLocations
{
//! true enables light
GLint enabled = -1;
//! Light type
GLint type = -1;
//! Position or direction vector
GLint position = -1;
//! Ambient color
GLint ambient = -1;
//! Diffuse color
GLint diffuse = -1;
//! Specular color
GLint specular = -1;
//! Attenuation
GLint attenuation = -1;
} lights[8];
LightLocations lights[8] = {};
};
/**