diff --git a/NonEuclidean/Engine.cpp b/NonEuclidean/Engine.cpp index 8409651..0e2de60 100644 --- a/NonEuclidean/Engine.cpp +++ b/NonEuclidean/Engine.cpp @@ -260,7 +260,7 @@ void Engine::Render(const Camera& cam, GLuint curFBO, const Portal* skipPortal) } GH_REC_LEVEL += 1; } - + #if 0 //Debug draw colliders for (size_t i = 0; i < vObjects.size(); ++i) { diff --git a/NonEuclidean/FrameBuffer.cpp b/NonEuclidean/FrameBuffer.cpp index 353bdce..af3250e 100644 --- a/NonEuclidean/FrameBuffer.cpp +++ b/NonEuclidean/FrameBuffer.cpp @@ -33,6 +33,13 @@ FrameBuffer::FrameBuffer() { glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); } +FrameBuffer::~FrameBuffer() +{ + glDeleteRenderbuffersEXT(1, &renderBuf); + glDeleteFramebuffersEXT(1, &fbo); + glDeleteTextures(1, &texId); +} + void FrameBuffer::Use() { glBindTexture(GL_TEXTURE_2D, texId); } diff --git a/NonEuclidean/FrameBuffer.h b/NonEuclidean/FrameBuffer.h index 36c9e79..7eb43f1 100644 --- a/NonEuclidean/FrameBuffer.h +++ b/NonEuclidean/FrameBuffer.h @@ -8,7 +8,7 @@ class Portal; class FrameBuffer { public: FrameBuffer(); - + ~FrameBuffer(); void Render(const Camera& cam, GLuint curFBO, const Portal* skipPortal); void Use(); diff --git a/NonEuclidean/Texture.cpp b/NonEuclidean/Texture.cpp index 7c2427c..2735c94 100644 --- a/NonEuclidean/Texture.cpp +++ b/NonEuclidean/Texture.cpp @@ -64,6 +64,11 @@ Texture::Texture(const char* fname, int rows, int cols) { delete[] img; } +Texture::~Texture() +{ + glDeleteTextures(1, &texId); +} + void Texture::Use() { if (is3D) { glBindTexture(GL_TEXTURE_2D_ARRAY, texId); diff --git a/NonEuclidean/Texture.h b/NonEuclidean/Texture.h index c76019e..d181a5b 100644 --- a/NonEuclidean/Texture.h +++ b/NonEuclidean/Texture.h @@ -4,7 +4,7 @@ class Texture { public: Texture(const char* fname, int rows, int cols); - + ~Texture(); void Use(); private: