X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpipeline.cpp;h=bcbbb05fe3b63aa0064c6e71db0fa5142f28d867;hb=574abfb;hp=fd638fb6ebbbbdd0a95a78caa57586d67b7660bf;hpb=58e3368ddb21de5c4bc6e208440de369fe4876f1;p=libs%2Fgl.git diff --git a/source/pipeline.cpp b/source/pipeline.cpp index fd638fb6..bcbbb05f 100644 --- a/source/pipeline.cpp +++ b/source/pipeline.cpp @@ -40,8 +40,17 @@ void Pipeline::set_hdr(bool h) if(h==hdr) return; + bool old_hdr= hdr; hdr = h; - create_targets(2); + try + { + create_targets(2); + } + catch(...) + { + hdr = old_hdr; + throw; + } } void Pipeline::set_multisample(unsigned s) @@ -111,7 +120,15 @@ void Pipeline::remove_renderable(const Renderable &r) void Pipeline::add_postprocessor(PostProcessor &pp) { postproc.push_back(&pp); - create_targets(0); + try + { + create_targets(0); + } + catch(...) + { + postproc.pop_back(); + throw; + } } void Pipeline::setup_frame() const