From c4cacaf8f9225e006e6bb35f81eb6c2f78602bdc Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 10 Oct 2010 09:49:41 +0000 Subject: [PATCH] Don't bind RenderBuffer in constructor Use correct parameter for glDrawBuffer --- source/framebuffer.cpp | 6 +++--- source/renderbuffer.cpp | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/framebuffer.cpp b/source/framebuffer.cpp index 8dbd2d0e..77ac21be 100644 --- a/source/framebuffer.cpp +++ b/source/framebuffer.cpp @@ -52,7 +52,7 @@ void Framebuffer::update_attachment(unsigned mask) const { if(current()==this) { - bool has_color = false; + GLenum color_buf = GL_NONE; bool has_depth = false; for(unsigned i=0; i=COLOR_ATTACHMENT0 && attch.attachment<=COLOR_ATTACHMENT3) - has_color = true; + color_buf = attch.attachment; if(attch.attachment==DEPTH_ATTACHMENT) has_depth = true; } - glDrawBuffer(has_color ? GL_FRONT : GL_NONE); + glDrawBuffer(color_buf); glDepthMask(has_depth); } else diff --git a/source/renderbuffer.cpp b/source/renderbuffer.cpp index 95cf56b8..d28237be 100644 --- a/source/renderbuffer.cpp +++ b/source/renderbuffer.cpp @@ -17,7 +17,6 @@ Renderbuffer::Renderbuffer() static RequireExtension _ext("GL_EXT_framebuffer_object"); glGenRenderbuffersEXT(1, &id); - bind(); } Renderbuffer::~Renderbuffer() -- 2.43.0