]> git.tdb.fi Git - libs/gl.git/blobdiff - source/simplescene.h
Remove dynamic allocation from VertexFormat
[libs/gl.git] / source / simplescene.h
index b28b5c0ce12e628d4bfb1b1b1dbe7550746a7658..fd834111354635a3c34d29d9158a3faf45042b1a 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2010  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GL_SIMPLESCENE_H_
 #define MSP_GL_SIMPLESCENE_H_
 
@@ -15,20 +8,30 @@ namespace Msp {
 namespace GL {
 
 /**
-The simplest possible Scene.  Rendering order is unspecified.
+A simple yet efficient scene.  Rendering order is unspecified.
 */
 class SimpleScene: public Scene
 {
 private:
        typedef std::set<const Renderable *> RenderableSet;
+       typedef std::vector<const Renderable *> RenderableArray;
 
        RenderableSet renderables;
+       mutable RenderableArray cache;
 
 public:
        virtual void add(const Renderable &);
        virtual void remove(const Renderable &);
 
-       virtual void render(const Tag &tag = Tag()) const;
+private:
+       void populate_cache() const;
+
+public:
+       virtual void setup_frame() const;
+       virtual void finish_frame() const;
+
+       using Scene::render;
+       virtual void render(Renderer &, const Tag & = Tag()) const;
 };
 
 } // namespace GL