#include "light.h"
#include "openglstate.h"
#include "GL/glew.h"
namespace M3D {

Light::Light()
{
}


Light::~Light()
{
}

void Light::set_location( const Coords &location )
{
	_location_ = location;
}

void Light::set_color( const Color4f &color )
{
	_light_color_ = color;
}

void Light::set_light( uint32_t frame_num, OpenGLState * gl_state )
{
	int programID = gl_state->get_current_program();
	GLint location = glGetUniformLocation ( programID, "LightColor" );
	if(location != -1)glUniform4fv ( location, 1, (float*)&_light_color_ );
	location = glGetUniformLocation ( programID, "LightPosition" );
	if(location != -1)glUniform3fv ( location, 1, (float*)&_location_ );

}
}

