49 lines
1.0 KiB
C++
49 lines
1.0 KiB
C++
#ifndef FORWARDMODULE_H
|
|
#define FORWARDMODULE_H
|
|
|
|
#include "module.h"
|
|
#include <vector>
|
|
#include <cstddef>
|
|
#include <glew/glew.h>
|
|
#include "shadersource.h"
|
|
#include "material.h"
|
|
|
|
class Light;
|
|
class Scene;
|
|
class PhongEntity;
|
|
|
|
class ForwardModule : public Module
|
|
{
|
|
public:
|
|
ForwardModule() : shaderSources(NULL) {}
|
|
|
|
virtual void renderGL(Camera* myCamera, Scene* scene);
|
|
virtual bool requiresModernOpenGL() {return false;}
|
|
|
|
// modern opengl methods
|
|
|
|
void setShaderSource(ShaderSource* source);
|
|
void compileShaders(Scene* scene);
|
|
|
|
private:
|
|
enum {
|
|
// light flags
|
|
AMBIENT_LIGHT,
|
|
DIRECTIONNAL_LIGHT,
|
|
POINT_LIGHT,
|
|
// count
|
|
NB_LIGHT_FLAGS
|
|
};
|
|
|
|
static const char* const flagStr[NB_FLAGS];
|
|
static const char* const lightStr[NB_LIGHT_FLAGS];
|
|
|
|
ShaderSource* shaderSources;
|
|
std::vector<Shader*> shaders;
|
|
std::vector<unsigned int> flags;
|
|
|
|
void lightPass(Light* light, Camera* myCamera, Scene* scene, unsigned int type);
|
|
};
|
|
|
|
#endif // FORWARDMODULE_H
|