]> git.tdb.fi Git - libs/gl.git/blob - source/scene.h
Allow Renderables in a Scene to specify ordering
[libs/gl.git] / source / scene.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_SCENE_H_
9 #define MSP_GL_SCENE_H_
10
11 #include <set>
12 #include "renderable.h"
13
14 namespace Msp {
15 namespace GL {
16
17 class Scene: public Renderable
18 {
19 private:
20         struct Compare
21         {
22                 bool operator()(const Renderable *, const Renderable *) const;
23         };
24
25         std::set<const Renderable *, Compare> renderables;
26
27 public:
28         void add(const Renderable &);
29         void remove(const Renderable &);
30
31         virtual bool has_pass(const Tag &) const { return true; }
32         virtual void render(const Tag &tag=Tag()) const;
33 };
34
35 } // namespace GL
36 } // namespace Msp
37
38 #endif