]> git.tdb.fi Git - libs/gl.git/blobdiff - source/simplescene.cpp
Change Scene into an abstract base class and add a few subclasses
[libs/gl.git] / source / simplescene.cpp
diff --git a/source/simplescene.cpp b/source/simplescene.cpp
new file mode 100644 (file)
index 0000000..b410374
--- /dev/null
@@ -0,0 +1,30 @@
+/* $Id$
+
+This file is part of libmspgl
+Copyright © 2010  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
+#include "simplescene.h"
+
+namespace Msp {
+namespace GL {
+
+void SimpleScene::add(const Renderable &r)
+{
+       renderables.insert(&r);
+}
+
+void SimpleScene::remove(const Renderable &r)
+{
+       renderables.erase(&r);
+}
+
+void SimpleScene::render(const Tag &tag) const
+{
+       for(RenderableSet::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
+               (*i)->render(tag);
+}
+
+} // namespace GL
+} // namespace Msp