refactor & fix random deleting texture

This commit is contained in:
MihailRis
2025-05-10 16:13:06 +03:00
parent e158b384fa
commit 8bb03a004f
7 changed files with 65 additions and 64 deletions
+1 -4
View File
@@ -42,9 +42,6 @@ Framebuffer::Framebuffer(uint width, uint height, bool alpha)
// Setup color attachment (texture)
texture = create_texture(width, height, format);
unsigned int attachments[1] = { GL_COLOR_ATTACHMENT0 };
glDrawBuffers(1, attachments);
// Setup depth attachment
glGenRenderbuffers(1, &depth);
glBindRenderbuffer(GL_RENDERBUFFER, depth);
@@ -60,7 +57,7 @@ Framebuffer::Framebuffer(uint width, uint height, bool alpha)
Framebuffer::~Framebuffer() {
glDeleteFramebuffers(1, &fbo);
glDeleteTextures(1, &depth);
glDeleteRenderbuffers(1, &depth);
}
void Framebuffer::bind() {