47 lines
1.1 KiB
C++
47 lines
1.1 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"
|
|
#include "framebuffer.h"
|
|
|
|
class Light;
|
|
class Scene;
|
|
class PhongEntity;
|
|
|
|
class ForwardModule : public Module
|
|
{
|
|
public:
|
|
ForwardModule() :
|
|
shaderSources(NULL),
|
|
renderTarget(FrameBuffer::screen)
|
|
{}
|
|
|
|
virtual void renderGL(Camera* myCamera, Scene* scene);
|
|
virtual bool requiresModernOpenGL() {return true;} // write some compatibility code to change that to false
|
|
|
|
// modern opengl methods
|
|
|
|
void setShaderSource(ShaderSource* source);
|
|
void compileShaders(Scene* scene);
|
|
|
|
void setRenderTarget(FrameBuffer* target);
|
|
|
|
private:
|
|
static const char* const flagStr[NB_FLAGS];
|
|
|
|
ShaderSource* shaderSources;
|
|
std::vector<Shader*> shaders;
|
|
std::vector<unsigned int> geometryFlagList;
|
|
std::vector<unsigned int> lightFlagList;
|
|
const FrameBuffer* renderTarget;
|
|
|
|
void lightPass(Camera* myCamera, Scene* scene, Light* light);
|
|
};
|
|
|
|
#endif // FORWARDMODULE_H
|