]> git.tdb.fi Git - libs/gl.git/blob - source/scene.cpp
Add a Tag class to identify passes
[libs/gl.git] / source / scene.cpp
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 #include "scene.h"
9
10 using namespace std;
11
12 namespace Msp {
13 namespace GL {
14
15 void Scene::add(const Renderable &r)
16 {
17         renderables.insert(&r);
18 }
19
20 void Scene::remove(const Renderable &r)
21 {
22         renderables.erase(&r);
23 }
24
25 void Scene::render(const Tag &tag) const
26 {
27         for(set<const Renderable *>::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
28                 if((*i)->has_pass(tag))
29                         (*i)->render(tag);
30 }
31
32 } // namespace GL
33 } // namespace Msp