X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fpipeline.cpp;h=bcbbb05fe3b63aa0064c6e71db0fa5142f28d867;hp=fd638fb6ebbbbdd0a95a78caa57586d67b7660bf;hb=17af32b5943c845c97baee0733ca86c5a5b722ed;hpb=b8ddfb1f874bc18fa9b6ea27d08b009c8264a577 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