1 #include <msp/core/algorithm.h>
3 #include "simplescene.h"
8 void SimpleScene::add(Renderable &r)
10 auto i = lower_bound(content, &r);
11 if(i==content.end() || *i!=&r)
12 content.insert(i, &r);
15 void SimpleScene::remove(Renderable &r)
17 auto i = find(content, &r);
22 void SimpleScene::setup_frame(Renderer &renderer)
24 for(Renderable *r: content)
25 r->setup_frame(renderer);
28 void SimpleScene::finish_frame()
30 for(Renderable *r: content)
34 void SimpleScene::render(Renderer &renderer, Tag tag) const
36 if(setup_frustum(renderer))
38 for(Renderable *r: content)
40 r->render(renderer, tag);
44 for(Renderable *r: content)
45 r->render(renderer, tag);