height(h),
hdr(d),
samples(0),
- target_ms(0)
+ target_ms(0),
+ in_frame(false)
{
target[0] = 0;
target[1] = 0;
create_targets(false);
}
+void Pipeline::setup_frame() const
+{
+ in_frame = true;
+ for(vector<Slot>::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
+ i->renderable->setup_frame();
+}
+
+void Pipeline::finish_frame() const
+{
+ in_frame = false;
+ for(vector<Slot>::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
+ i->renderable->finish_frame();
+}
+
void Pipeline::render(const Tag &tag) const
{
if(tag.id)
if(tag.id)
return;
+ bool was_in_frame = in_frame;
+ if(!in_frame)
+ setup_frame();
+
if(target[0])
{
Framebuffer &fbo = (samples ? target_ms->fbo : target[0]->fbo);
Framebuffer::unbind();
}
+
+ if(!was_in_frame)
+ finish_frame();
}
void Pipeline::create_targets(bool recreate)