]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/framebuffer.cpp
Make framebuffer attachment accessors public
[libs/gl.git] / source / core / framebuffer.cpp
index b0777171448b5a27222e4b631e8d04cc52143ae6..8a1a52316f9fa6835e685570f6357d14955389d0 100644 (file)
@@ -165,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<attachments.size() ? attachments[i].tex : 0);
+}
+
 void Framebuffer::require_complete() const
 {
        bool layered = (!attachments.empty() && attachments.front().layer<0);