Framebuffer::Framebuffer(bool s):
- FramebufferBackend(s),
- dirty(0)
-{
- if(s)
- {
- format = get_system_format();
- get_system_size(width, height);
- }
-}
+ FramebufferBackend(s)
+{ }
Framebuffer::Framebuffer():
- FramebufferBackend(false),
- width(0),
- height(0),
- dirty(0)
+ FramebufferBackend(false)
{ }
Framebuffer::Framebuffer(FrameAttachment fa):
}
}
-void Framebuffer::resize(const WindowView &view)
+const Texture *Framebuffer::get_attachment(FrameAttachment attch) const
{
if(attachments.empty())
- throw invalid_operation("Framebuffer::resize");
+ return 0;
+
+ int i = format.index(attch);
+ return (i>=0 ? attachments[i].tex : 0);
+}
- width = view.get_width();
- height = view.get_height();
+const Texture *Framebuffer::get_attachment(unsigned i) const
+{
+ return (i<attachments.size() ? attachments[i].tex : 0);
}
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)
{