#ifndef GRAPHICS_HH_INCLUDED #define GRAPHICS_HH_INCLUDED #include #include #include #include #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 updateLights(); void updateClosestLights(); bool compareLightDistances(Light a, Light b); void saveDepthBufferToDisk(int face, std::string); double lastUpdate; glm::uvec2 windowSize; float nearPlane; float farPlane; std::vector closestLights; ACGL::OpenGL::SharedShaderProgram lightingShader; ACGL::OpenGL::SharedShaderProgram depthCubeShader; ACGL::OpenGL::SharedShaderProgram depthShader; ACGL::OpenGL::SharedShaderProgram flameShader; ACGL::OpenGL::SharedTexture2D depthTexture; ACGL::OpenGL::SharedFrameBufferObject framebuffer; std::vector depth_cubeMaps; ACGL::OpenGL::SharedFrameBufferObject framebuffer_cube; ACGL::OpenGL::SharedVertexArrayObject flame_positions; ACGL::OpenGL::SharedArrayBuffer flame_positions_ab; int cube_size; unsigned int maxShadowRenderCount; Level* level; int number_of_texture_units = 0; }; #endif