SparrowRenderer/phongmodule.cpp

20 lines
697 B
C++

#include "phongmodule.h"
#include "lights.h"
#include "shader.h"
#include "resourcebase.h"
PhongModule::PhongModule(Lights* myDirLights, Lights* myPointLights) :
BasicModule(ResourceBase::getShader("phong")), dirLights(myDirLights), pointLights(myPointLights)
{
nbDirLightsLocation = shader->getLocation("nbDirLights");
dirLightsLocation = shader->getLocation("dirLights");
nbPointLightsLocation = shader->getLocation("nbPointLights");
pointLightsLocation = shader->getLocation("pointLights");
}
void PhongModule::bindModule()
{
dirLights->bind(dirLightsLocation, nbDirLightsLocation, shader);
pointLights->bind(pointLightsLocation, nbPointLightsLocation, shader);
}