X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fpipeline.cpp;h=037741d24e4e1bfa0372c09943c1509cfad5b115;hp=9e2976ab69e5dc4e383c413be18c9239ac786a94;hb=18240e2bb031551e9c72a55c7d974904d209760a;hpb=e6bd08e977f3138bfcfa3a1b6cc45201c383e016 diff --git a/source/pipeline.cpp b/source/pipeline.cpp index 9e2976ab..037741d2 100644 --- a/source/pipeline.cpp +++ b/source/pipeline.cpp @@ -136,7 +136,19 @@ Pipeline::Pass &Pipeline::add_pass(const Tag &tag, Renderable &r) void Pipeline::add_postprocessor(PostProcessor &pp) { - postproc.push_back(&pp); + add_postprocessor(&pp, true); +} + +void Pipeline::add_postprocessor_owned(PostProcessor *pp) +{ + add_postprocessor(pp, false); +} + +void Pipeline::add_postprocessor(PostProcessor *pp, bool keep) +{ + postproc.push_back(pp); + if(keep) + postproc.back().keep(); try { create_targets(0); @@ -192,7 +204,6 @@ void Pipeline::render(Renderer &renderer, const Tag &tag) const fbo.clear(COLOR_BUFFER_BIT|DEPTH_BUFFER_BIT); } - for(PassList::const_iterator i=passes.begin(); i!=passes.end(); ++i) { if(const DepthTest *dt = i->get_depth_test())