]> git.tdb.fi Git - libs/gl.git/blobdiff - source/framebuffer.cpp
Don't bind RenderBuffer in constructor
[libs/gl.git] / source / framebuffer.cpp
index 8dbd2d0ee93bd20940b26326c1d2aaeb0c3f25a1..77ac21be6b0e6ef76da3928247b54b2c69074c5b 100644 (file)
@@ -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<attachments.size(); ++i)
                {
@@ -68,12 +68,12 @@ void Framebuffer::update_attachment(unsigned mask) const
                        }
 
                        if(attch.attachment>=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