#ifndef PHONGMODULE_H #define PHONGMODULE_H #include "module.h" #include #include #include #include "lights.h" class Shader; class PhongEntity; class PhongModule : public Module { public: enum ShaderType { PHONG_COLOR, // rendering untextured mesh PHONG_TEXTURE, // rendering textured mesh //TODO : rendering bump mapped mesh NB_SHADERS }; PhongModule(Lights::Light* myDirLight, Lights* myPointLights); void addEntity(PhongEntity* myEntity); void clearEntities(); virtual void renderGL(Camera* myCamera, Scene* scene = NULL); virtual bool requiresModernOpenGL() {return false;} // modern opengl methods /** * @brief all used shaders shall be provided through this method before rendering */ 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 entities; static Shader* shaders[NB_SHADERS]; }; #endif // PHONGMODULE_H