if(s==samples)
return;
+ unsigned old_samples = samples;
samples = s;
- create_targets(1);
+ try
+ {
+ create_targets(1);
+ }
+ catch(...)
+ {
+ samples = old_samples;
+ throw;
+ }
}
void Pipeline::set_camera(const Camera *c)
setup_frame();
const Framebuffer *out_fbo = Framebuffer::current();
- /* Binding the current object is a no-op, but this will restore the original
- FBO in case an exception is thrown. */
- Bind restore_fbo(out_fbo, true);
+ // XXX Make sure the correct FBO is restored if an exception is thrown
if(target[0])
{
renderer.render(*j->renderable, i->get_tag());
}
+ renderer.end();
+
if(target[0])
{
if(samples)