-#include "arb_draw_buffers.h"
+#include <msp/gl/extensions/arb_draw_buffers.h>
+#include <msp/gl/extensions/ext_framebuffer_blit.h>
+#include <msp/gl/extensions/ext_framebuffer_object.h>
#include "error.h"
-#include "ext_framebuffer_blit.h"
-#include "ext_framebuffer_object.h"
#include "framebuffer.h"
#include "misc.h"
#include "renderbuffer.h"
}
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
FramebufferStatus Framebuffer::check_status() const
{
- Bind _bind(this, true);
+ BindRestore _bind(this);
return static_cast<FramebufferStatus>(glCheckFramebufferStatus(GL_FRAMEBUFFER));
}
void Framebuffer::clear(BufferBits bits)
{
- Bind _bind(this, true);
+ BindRestore _bind(this);
glClear(bits);
}
}
const Framebuffer *Framebuffer::current()
-{
+{
if(!cur_obj)
cur_obj = &system();
return cur_obj;