X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fframebuffer.cpp;h=8a1a52316f9fa6835e685570f6357d14955389d0;hb=f4f81f1d86d50b29b9a44b237f67c6f5ad8f0523;hp=70c19859d128aeda40f1f9a1b34cb7cfd4774e06;hpb=b9e720f36185c6fe4d39a1056ecb88dec0ce950d;p=libs%2Fgl.git diff --git a/source/core/framebuffer.cpp b/source/core/framebuffer.cpp index 70c19859..8a1a5231 100644 --- a/source/core/framebuffer.cpp +++ b/source/core/framebuffer.cpp @@ -16,15 +16,11 @@ framebuffer_incomplete::framebuffer_incomplete(const std::string &reason): Framebuffer::Framebuffer(bool s): - FramebufferBackend(s), - dirty(0) + FramebufferBackend(s) { } Framebuffer::Framebuffer(): - FramebufferBackend(false), - width(0), - height(0), - dirty(0) + FramebufferBackend(false) { } Framebuffer::Framebuffer(FrameAttachment fa): @@ -169,6 +165,20 @@ void Framebuffer::detach(FrameAttachment attch) } } +const Texture *Framebuffer::get_attachment(FrameAttachment attch) const +{ + if(attachments.empty()) + return 0; + + int i = format.index(attch); + return (i>=0 ? attachments[i].tex : 0); +} + +const Texture *Framebuffer::get_attachment(unsigned i) const +{ + return (i