2 #include "objectinstance.h"
3 #include "instancescene.h"
9 void InstanceScene::add(const Renderable &r)
11 renderables[r.get_instance_key()].insert(&r);
14 void InstanceScene::remove(const Renderable &r)
16 InstanceMap::iterator i = renderables.find(r.get_instance_key());
17 if(i!=renderables.end())
25 void InstanceScene::setup_frame() const
27 for(InstanceMap::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
28 for(RenderableSet::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
32 void InstanceScene::finish_frame() const
34 for(InstanceMap::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
35 for(RenderableSet::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
39 void InstanceScene::render(Renderer &renderer, const Tag &tag) const
41 setup_cullers(renderer);
42 for(InstanceMap::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
43 for(RenderableSet::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
44 if(!cull(renderer, **j))
45 renderer.render(**j, tag);