SparrowRenderer/src/skyboxmodule.h
2016-06-06 17:02:25 +02:00

41 lines
898 B
C++

#ifndef SKYBOXMODULE_H
#define SKYBOXMODULE_H
#include "opengl.h"
#include "module.h"
#include <string>
class Shader;
class Texture;
class FrameBuffer;
class SkyboxModule : public Module
{
static const GLfloat skyboxVertices[];
static const GLubyte skyboxIndices[];
static const std::string vertSource;
static const std::string fragSource;
int width;
int height;
// modern opengl variables
GLuint vao;
GLuint vbos[2];
GLuint mvpLocation;
Shader* shader;
Texture* cubeMap;
const FrameBuffer* renderTarget;
public:
SkyboxModule(Texture* myCubeMap);
~SkyboxModule();
virtual void renderGL(Camera* myCamera, Scene* scene = NULL);
virtual bool requiresModernOpenGL() {return false;}
virtual void resize(int w, int h) {width = w; height = h;}
void setRenderTarget(const FrameBuffer* target);
};
#endif // SKYBOXMODULE_H