]> git.tdb.fi Git - libs/gl.git/blob - source/simplescene.h
Add a Scene type that sorts its renderables by depth
[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 The simplest possible Scene.  Rendering order is unspecified.
12 */
13 class SimpleScene: public Scene
14 {
15 protected:
16         typedef std::set<const Renderable *> RenderableSet;
17
18         RenderableSet renderables;
19
20 public:
21         virtual void add(const Renderable &);
22         virtual void remove(const Renderable &);
23
24         virtual void setup_frame() const;
25         virtual void finish_frame() const;
26
27         using Scene::render;
28         virtual void render(Renderer &, const Tag & = Tag()) const;
29 };
30
31 } // namespace GL
32 } // namespace Msp
33
34 #endif