X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fframebuffer.cpp;h=70c19859d128aeda40f1f9a1b34cb7cfd4774e06;hb=b9e720f36185c6fe4d39a1056ecb88dec0ce950d;hp=cc8dec4f5358346fbf53f33c002a745420fb098b;hpb=38712d8ecc57d043a2419ffbaeeb57f7a6586f14;p=libs%2Fgl.git diff --git a/source/core/framebuffer.cpp b/source/core/framebuffer.cpp index cc8dec4f..70c19859 100644 --- a/source/core/framebuffer.cpp +++ b/source/core/framebuffer.cpp @@ -18,13 +18,7 @@ framebuffer_incomplete::framebuffer_incomplete(const std::string &reason): Framebuffer::Framebuffer(bool s): FramebufferBackend(s), dirty(0) -{ - if(s) - { - format = get_system_format(); - get_system_size(width, height); - } -} +{ } Framebuffer::Framebuffer(): FramebufferBackend(false), @@ -47,7 +41,7 @@ Framebuffer::Framebuffer(const FrameFormat &f): void Framebuffer::set_format(const FrameFormat &fmt) { - if(!format.empty() || !id) + if(!format.empty()) throw invalid_operation("Framebuffer::set_format"); if(fmt.empty() || !is_format_supported(fmt)) throw invalid_argument("Framebuffer::set_format"); @@ -107,7 +101,7 @@ void Framebuffer::check_size() void Framebuffer::set_attachment(FrameAttachment attch, Texture &tex, unsigned level, int layer, unsigned samples) { - if(format.empty() || !id) + if(format.empty() || attachments.empty()) throw invalid_operation("Framebuffer::attach"); if((format.get_samples()>1 && samples!=format.get_samples()) || (format.get_samples()==1 && samples)) @@ -163,7 +157,7 @@ void Framebuffer::attach_layered(FrameAttachment attch, TextureCube &tex, unsign void Framebuffer::detach(FrameAttachment attch) { - if(!id) + if(attachments.empty()) throw invalid_operation("Framebuffer::detach"); int i = format.index(attch); @@ -175,20 +169,8 @@ void Framebuffer::detach(FrameAttachment attch) } } -void Framebuffer::resize(const WindowView &view) -{ - if(id) - throw invalid_operation("Framebuffer::resize"); - - width = view.get_width(); - height = view.get_height(); -} - void Framebuffer::require_complete() const { - if(!id) - return; - bool layered = (!attachments.empty() && attachments.front().layer<0); for(const Attachment &a: attachments) { @@ -201,12 +183,6 @@ void Framebuffer::require_complete() const FramebufferBackend::require_complete(); } -Framebuffer &Framebuffer::system() -{ - static Framebuffer sys_framebuf(true); - return sys_framebuf; -} - void Framebuffer::Attachment::set(Texture &t, unsigned l, int z) {