X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fframebuffer.cpp;h=c90bb22469da6b7633ac405d1dc2884d85ef61aa;hp=f402b64366e98e4d1cc44e56fb446d14a495d4bf;hb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;hpb=67f22642d636861f90a016077c9387b7b8397414 diff --git a/source/framebuffer.cpp b/source/framebuffer.cpp index f402b643..c90bb224 100644 --- a/source/framebuffer.cpp +++ b/source/framebuffer.cpp @@ -308,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); @@ -355,7 +360,7 @@ void Framebuffer::blit_from(const Framebuffer &other, BufferBits bits, bool filt void Framebuffer::bind() const { - if(attachments.empty()) + if(id && attachments.empty()) throw invalid_operation("Framebuffer::bind"); if(set_current(this))