mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
refactor & fix random deleting texture
This commit is contained in:
parent
e158b384fa
commit
8bb03a004f
7 changed files with 65 additions and 64 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue