]> git.tdb.fi Git - libs/gl.git/blob - source/simplescene.h
Require import module names to be identifiers
[libs/gl.git] / source / 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 private:
16         typedef std::set<Renderable *> RenderableSet;
17         typedef std::vector<Renderable *> RenderableArray;
18
19         RenderableSet renderables;
20         mutable RenderableArray 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 &, const Tag & = Tag()) const;
34 };
35
36 } // namespace GL
37 } // namespace Msp
38
39 #endif