SparrowRenderer/forwardmodule.h
2015-11-29 22:32:44 +01:00

49 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"
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 true;} // write some compatibility code to change that to 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(Camera* myCamera, Scene* scene, Light* light, unsigned int type);
};
#endif // FORWARDMODULE_H