height(h),
hdr(d),
samples(0),
- target_ms(0),
- in_frame(false)
+ target_ms(0)
{
target[0] = 0;
target[1] = 0;
void Pipeline::setup_frame() const
{
- in_frame = true;
for(PassList::const_iterator i=passes.begin(); i!=passes.end(); ++i)
if(const Renderable *renderable = i->get_renderable())
renderable->setup_frame();
void Pipeline::finish_frame() const
{
- in_frame = false;
for(PassList::const_iterator i=passes.begin(); i!=passes.end(); ++i)
if(const Renderable *renderable = i->get_renderable())
renderable->finish_frame();
return;
Renderer renderer(camera);
+ setup_frame();
render(renderer, tag);
+ finish_frame();
}
void Pipeline::render(Renderer &renderer, const Tag &tag) const
if(tag.id)
return;
- bool was_in_frame = in_frame;
- if(!in_frame)
- setup_frame();
-
const Framebuffer *out_fbo = Framebuffer::current();
// These is a no-ops but will ensure the related state gets restored
BindRestore restore_fbo(out_fbo);
postproc[i]->render(renderer, color, depth);
}
}
-
- if(!was_in_frame)
- finish_frame();
}
void Pipeline::create_targets(unsigned recreate)