Saxum/graphics.hh

42 lines
1.3 KiB
C++
Raw Normal View History

2014-10-20 16:23:25 +00:00
#ifndef GRAPHICS_HH_INCLUDED
#define GRAPHICS_HH_INCLUDED
#include <ACGL/OpenGL/GL.hh>
2014-10-20 16:23:25 +00:00
#include <GLFW/glfw3.h>
2014-10-20 16:49:10 +00:00
#include <ACGL/Math/Math.hh>
#include <ACGL/OpenGL/Objects/FrameBufferObject.hh>
#include "level.hh"
class Graphics {
public:
Graphics(glm::uvec2 windowSize, float nearPlane, float farPlane);
Graphics();
void init(Level* level);
void render(double time);
glm::mat4 buildViewMatrix(Level* level);
glm::uvec2 getWindowSize();
void resize(glm::uvec2 windowSize);
float getFarPlane();
void saveDepthBuffer();
private:
bool saveDepthBufferBool;
void updateLights();
2015-01-27 10:14:00 +00:00
void saveDepthBufferToDisk(int face, std::string);
double lastUpdate;
glm::uvec2 windowSize;
float nearPlane;
float farPlane;
ACGL::OpenGL::SharedShaderProgram lightingShader;
ACGL::OpenGL::SharedShaderProgram depthShader;
ACGL::OpenGL::SharedTexture2D depthTexture;
ACGL::OpenGL::SharedFrameBufferObject framebuffer;
std::vector<ACGL::OpenGL::SharedTextureCubeMap> depth_cubeMaps;
ACGL::OpenGL::SharedFrameBufferObject framebuffer_cube;
ACGL::OpenGL::SharedTexture2D depthTexture_cube;
static const int cube_size;
Level* level;
};
2014-10-20 16:49:10 +00:00
#endif