SparrowRenderer/phongmodule.h
2015-09-08 17:49:34 +02:00

40 lines
875 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();
virtual void renderGL(Camera* myCamera);
virtual bool isAvailable() {return GLEW_VERSION_3_3;}
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