X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fframebuffer.cpp;h=8f54020009586cd5b20e97f64a7faa14d2327e17;hb=ae9abd6be3e556d0a202cc5ab05668da715382c9;hp=4d6c1752593cdbe54ac60f33d595af5dc1cd6491;hpb=fe5bf090db687ef1dd1084218156bcbc0b801081;p=libs%2Fgl.git diff --git a/source/framebuffer.cpp b/source/framebuffer.cpp index 4d6c1752..8f540200 100644 --- a/source/framebuffer.cpp +++ b/source/framebuffer.cpp @@ -1,7 +1,7 @@ -#include "arb_draw_buffers.h" +#include +#include +#include #include "error.h" -#include "ext_framebuffer_blit.h" -#include "ext_framebuffer_object.h" #include "framebuffer.h" #include "misc.h" #include "renderbuffer.h" @@ -111,13 +111,20 @@ void Framebuffer::update_attachment(unsigned mask) const } if(color_bufs.empty()) + { glDrawBuffer(GL_NONE); + glReadBuffer(GL_NONE); + } else if(color_bufs.size()==1) + { glDrawBuffer(color_bufs.front()); + glReadBuffer(color_bufs.front()); + } else { static Require _req(ARB_draw_buffers); glDrawBuffers(color_bufs.size(), &color_bufs[0]); + glReadBuffer(color_bufs.front()); } } else