From 84c2141644d38b45c9796900b7a4b1032f7c347e Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 9 Mar 2024 02:21:26 +0300 Subject: [PATCH] fbo resizing fix --- src/graphics/Framebuffer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/graphics/Framebuffer.cpp b/src/graphics/Framebuffer.cpp index 5224bb2e..ded802cc 100644 --- a/src/graphics/Framebuffer.cpp +++ b/src/graphics/Framebuffer.cpp @@ -59,6 +59,13 @@ void Framebuffer::resize(uint width, uint height) { if (this->width == width && this->height == height) { return; } + this->width = width; + this->height = height; + + glBindRenderbuffer(GL_RENDERBUFFER, depth); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, width, height); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + texture->bind(); glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, GL_UNSIGNED_BYTE, nullptr); texture->unbind();