X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fsimplescene.cpp;fp=source%2Fsimplescene.cpp;h=b8c90517082ece5db4e1159d6f25dfaf8aef7c7e;hp=4ccc714b79d7eefbe898a43677c0284a81e0a2ff;hb=ead4a3d938971c364f43de99461b457696bf9a80;hpb=5592a115f0126ea8de1245e091338a8735b79d0e 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)