Saxum/graphics.hh

45 lines
1.5 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, int cube_size, unsigned int maxShadowRenderCount);
Graphics();
void init(Level* level);
void render(double time);
glm::mat4 buildViewMatrix(Level* level);
glm::uvec2 getWindowSize();
void resize(glm::uvec2 windowSize);
float getFarPlane();
private:
void updateShaderLights();
void updateClosestLights();
bool compareLightDistances(Light a, Light b);
2015-01-27 10:14:00 +00:00
void saveDepthBufferToDisk(int face, std::string);
double lastUpdate;
glm::uvec2 windowSize;
float nearPlane;
float farPlane;
std::vector<Light> closestLights;
ACGL::OpenGL::SharedShaderProgram lightingShader;
2015-02-09 23:27:13 +00:00
ACGL::OpenGL::SharedShaderProgram depthCubeShader;
ACGL::OpenGL::SharedShaderProgram depthShader;
ACGL::OpenGL::SharedTexture2D depthTexture;
ACGL::OpenGL::SharedFrameBufferObject framebuffer;
std::vector<ACGL::OpenGL::SharedTextureCubeMap> depth_cubeMaps;
ACGL::OpenGL::SharedFrameBufferObject framebuffer_cube;
int cube_size;
unsigned int maxShadowRenderCount;
Level* level;
int number_of_texture_units = 0;
};
2014-10-20 16:49:10 +00:00
#endif