X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsimplescene.h;h=fd834111354635a3c34d29d9158a3faf45042b1a;hb=3b159edbe4e80a2bc19c4c2fcd42cb996b9fbfe0;hp=35315926460d0727f3d9471e392e3e05744872fa;hpb=25c81b4953dd38993250321b9407ce8b0139cbeb;p=libs%2Fgl.git diff --git a/source/simplescene.h b/source/simplescene.h index 35315926..fd834111 100644 --- a/source/simplescene.h +++ b/source/simplescene.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2010-2011 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_SIMPLESCENE_H_ #define MSP_GL_SIMPLESCENE_H_ @@ -15,19 +8,28 @@ 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 RenderableSet; + typedef std::vector RenderableArray; RenderableSet renderables; + mutable RenderableArray cache; public: virtual void add(const Renderable &); virtual void remove(const Renderable &); +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; };