From: Mikko Rasa Date: Fri, 4 Dec 2015 13:59:10 +0000 (+0200) Subject: Immediately add renderables to the cache in SimpleScene::add X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ead4a3d938971c364f43de99461b457696bf9a80;p=libs%2Fgl.git Immediately add renderables to the cache in SimpleScene::add --- diff --git a/source/simplescene.cpp b/source/simplescene.cpp index 4ccc714b..b8c90517 100644 --- a/source/simplescene.cpp +++ b/source/simplescene.cpp @@ -6,8 +6,9 @@ namespace GL { void SimpleScene::add(const Renderable &r) { - renderables.insert(&r); - cache.clear(); + // Add to cache as well if the cache is valid + if(renderables.insert(&r).second && !cache.empty()) + cache.push_back(&r); } void SimpleScene::remove(const Renderable &r)