]> git.tdb.fi Git - libs/gl.git/blobdiff - source/framebuffer.cpp
Remove the deprecated ProgramBuilder class
[libs/gl.git] / source / framebuffer.cpp
index 237f417a9b45db982ffe54e8a59e0bf9a8895e8f..c90bb22469da6b7633ac405d1dc2884d85ef61aa 100644 (file)
@@ -39,6 +39,15 @@ void operator<<(LexicalConverter &conv, FramebufferStatus status)
        case FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
                conv.result("missing read buffer attachment");
                break;
+       case FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
+               conv.result("mismatched attachment sample counts");
+               break;
+       case FRAMEBUFFER_INCOMPLETE_LAYER_COUNT:
+               conv.result("mismatched attachment layer counts");
+               break;
+       case FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
+               conv.result("mismatched attachment layering");
+               break;
        case FRAMEBUFFER_UNSUPPORTED:
                conv.result("unsupported");
                break;
@@ -299,6 +308,11 @@ void Framebuffer::reset_viewport()
        viewport(0, 0, width, height);
 }
 
+void Framebuffer::clear()
+{
+       clear(COLOR_BUFFER_BIT|DEPTH_BUFFER_BIT|STENCIL_BUFFER_BIT);
+}
+
 void Framebuffer::clear(BufferBits bits)
 {
        BindRestore _bind(this);
@@ -346,6 +360,9 @@ void Framebuffer::blit_from(const Framebuffer &other, BufferBits bits, bool filt
 
 void Framebuffer::bind() const
 {
+       if(id && attachments.empty())
+               throw invalid_operation("Framebuffer::bind");
+
        if(set_current(this))
        {
                glBindFramebuffer(GL_FRAMEBUFFER, id);