]> git.tdb.fi Git - libs/gl.git/blob - source/render/simplescene.h
Use constructor delegation instead of init functions when possible
[libs/gl.git] / source / render / simplescene.h
1 #ifndef MSP_GL_SIMPLESCENE_H_
2 #define MSP_GL_SIMPLESCENE_H_
3
4 #include <set>
5 #include "scene.h"
6
7 namespace Msp {
8 namespace GL {
9
10 /**
11 A simple yet efficient scene.  Rendering order is unspecified.
12 */
13 class SimpleScene: public Scene
14 {
15 public:
16         using Scene::Loader;
17
18 private:
19         std::set<Renderable *> renderables;
20         mutable std::vector<Renderable *> cache;
21
22 public:
23         virtual void add(Renderable &);
24         virtual void remove(Renderable &);
25
26 private:
27         void populate_cache() const;
28
29 public:
30         virtual void setup_frame(Renderer &);
31         virtual void finish_frame();
32
33         virtual void render(Renderer &, Tag = Tag()) const;
34 };
35
36 } // namespace GL
37 } // namespace Msp
38
39 #endif