From 78f4e30f8f0671bad13288dd081e01607a183d92 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Wed, 4 Feb 2015 23:08:23 +0100 Subject: [PATCH] Additional cleanup. --- graphics.cc | 19 ------------------- graphics.hh | 4 ---- main.cc | 5 ----- 3 files changed, 28 deletions(-) diff --git a/graphics.cc b/graphics.cc index 635fe1c..6678bca 100644 --- a/graphics.cc +++ b/graphics.cc @@ -66,28 +66,12 @@ void Graphics::init(Level* level) { } framebuffer_cube = SharedFrameBufferObject(new FrameBufferObject()); - - depthTexture_cube = SharedTexture2D( new Texture2D(windowSize, GL_DEPTH_COMPONENT16)); - depthTexture_cube->setMinFilter(GL_NEAREST); - depthTexture_cube->setMagFilter(GL_NEAREST); - depthTexture_cube->setWrapS(GL_CLAMP_TO_EDGE); - depthTexture_cube->setWrapT(GL_CLAMP_TO_EDGE); - depthTexture_cube->setCompareMode(GL_COMPARE_REF_TO_TEXTURE); - - framebuffer_cube_mirror = SharedFrameBufferObject(new FrameBufferObject()); - framebuffer_cube_mirror->setDepthTexture(depthTexture_cube); - - saveDepthBufferBool = false; } glm::uvec2 Graphics::getWindowSize() { return windowSize; } -void Graphics::saveDepthBuffer() { - saveDepthBufferBool = true; -} - void Graphics::render(double time) { // At first render shadows @@ -106,9 +90,6 @@ void Graphics::render(double time) for (unsigned int i_pointlight = 0; i_pointlight<1 && i_pointlightgetLights()->size(); i_pointlight++) { // render each side of the cube for (int i_face = 0; i_face<6; i_face++) { - framebuffer_cube_mirror->bind(); - glClear(GL_DEPTH_BUFFER_BIT); - framebuffer_cube->bind(); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_CUBE_MAP_POSITIVE_X + i_face, depth_cubeMaps.at(i_pointlight)->getObjectName(), 0); glClear(GL_DEPTH_BUFFER_BIT); glm::mat4 viewMatrix = glm::lookAt(level->getLights()->at(i_pointlight).getPosition(), diff --git a/graphics.hh b/graphics.hh index 9a471d4..0d11513 100644 --- a/graphics.hh +++ b/graphics.hh @@ -18,9 +18,7 @@ class Graphics { glm::uvec2 getWindowSize(); void resize(glm::uvec2 windowSize); float getFarPlane(); - void saveDepthBuffer(); private: - bool saveDepthBufferBool; void updateLights(); void saveDepthBufferToDisk(int face, std::string); double lastUpdate; @@ -33,8 +31,6 @@ class Graphics { ACGL::OpenGL::SharedFrameBufferObject framebuffer; std::vector depth_cubeMaps; ACGL::OpenGL::SharedFrameBufferObject framebuffer_cube; - ACGL::OpenGL::SharedFrameBufferObject framebuffer_cube_mirror; - ACGL::OpenGL::SharedTexture2D depthTexture_cube; static const int cube_size; Level* level; }; diff --git a/main.cc b/main.cc index c516936..c639348 100644 --- a/main.cc +++ b/main.cc @@ -177,11 +177,6 @@ int main( int argc, char *argv[] ) } } - int stateP = glfwGetKey(window, GLFW_KEY_P); - if (stateP == GLFW_PRESS) { - app.getGraphics()->saveDepthBuffer(); - } - app.getGraphics()->render(now); lastUpdate = now;