42 lines
799 B
C++
42 lines
799 B
C++
#ifndef FORWARDMODULE_H
|
|
#define FORWARDMODULE_H
|
|
|
|
#include "module.h"
|
|
#include <vector>
|
|
#include <cstddef>
|
|
#include <glew/glew.h>
|
|
#include "shadersource.h"
|
|
|
|
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 {
|
|
NORMAL_MAP,
|
|
DIFFUSE_TEXTURE,
|
|
SPECULAR_TEXTURE,
|
|
ALPHA_MASK,
|
|
NB_FLAGS
|
|
};
|
|
|
|
static const char* const flagStr[NB_FLAGS];
|
|
|
|
ShaderSource* shaderSources;
|
|
Shader* shaders[1 << NB_FLAGS];
|
|
};
|
|
|
|
#endif // FORWARDMODULE_H
|