21 lines
532 B
C++
21 lines
532 B
C++
#include "lights.h"
|
|
#include "shader.h"
|
|
|
|
void Lights::addLight(const glm::vec3 &myPosition, const glm::vec3 myColor)
|
|
{
|
|
if(lights.size() < MAX_LIGHTS)
|
|
{
|
|
Light l;
|
|
l.position = myPosition;
|
|
l.color = myColor;
|
|
lights.push_back(l);
|
|
}
|
|
}
|
|
|
|
void Lights::bind(GLuint lightsLocation, GLuint nbLocation, Shader* shader)
|
|
{
|
|
if(lights.size() > 0)
|
|
shader->bindVec3Array(lightsLocation, (glm::vec3*)lights.data(), lights.size()*2);
|
|
shader->bindInteger(nbLocation, (GLuint)lights.size());
|
|
}
|