SparrowRenderer/phongmodule.h

39 lines
817 B
C++

#ifndef PHONGMODULE_H
#define PHONGMODULE_H
#include "module.h"
#include <vector>
#include <cstddef>
#include <glew/glew.h>
#include "lights.h"
class Shader;
class PhongEntity;
class PhongModule : public Module
{
public:
enum ShaderType {PHONG_COLOR, PHONG_TEXTURE, NB_SHADERS};
PhongModule(Lights::Light* myDirLight, Lights* myPointLights);
void addEntity(PhongEntity* myEntity);
void clearEntities();
void virtual renderGL(Camera* myCamera);
static void setShader(ShaderType slot, Shader* myShader);
static Shader* getShader(ShaderType slot);
private:
Lights::Light* dirLight;
Lights* pointLights;
GLuint dirLightLocation;
GLuint nbPointLightsLocation;
GLuint pointLightsLocation;
std::vector<PhongEntity*> entities;
static Shader* shaders[NB_SHADERS];
};
#endif // PHONGMODULE_H