50 lines
1.1 KiB
C++
50 lines
1.1 KiB
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, // 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);
|
|
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<PhongEntity*> entities;
|
|
|
|
static Shader* shaders[NB_SHADERS];
|
|
};
|
|
|
|
#endif // PHONGMODULE_H
|