X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Finstancescene.h;h=3f345124b47d5c086c48b81326f01230586212b3;hp=55bd266d7afbd80ea77dabbb725b620b14b7c1de;hb=8e14c298d9eaa47b81e27d5c25174bda958b445f;hpb=25c81b4953dd38993250321b9407ce8b0139cbeb diff --git a/source/instancescene.h b/source/instancescene.h index 55bd266d..3f345124 100644 --- a/source/instancescene.h +++ b/source/instancescene.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007-2008, 2010-2011 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_INSTANCESCENE_H_ #define MSP_GL_INSTANCESCENE_H_ @@ -15,26 +8,25 @@ Distributed under the LGPL namespace Msp { namespace GL { -class Object; -class ObjectInstance; - /** -A Scene optimized for rendering ObjectInstances. All instances of the same -Object are rendered in one go; otherwise the rendering order is unspecified. +A Scene optimized for rendering instanced Renderables, such as ObjectInstances. +All Renderables with the same instance key are rendered consecutively; within +the same key rendering order is unspecified. */ class InstanceScene: public Scene { private: - typedef std::set InstanceSet; - typedef std::map ObjectMap; - typedef std::set RenderableSet; + typedef std::set RenderableSet; + typedef std::map InstanceMap; - ObjectMap objects; - RenderableSet renderables; + InstanceMap renderables; public: - virtual void add(const Renderable &); - virtual void remove(const Renderable &); + virtual void add(Renderable &); + virtual void remove(Renderable &); + + virtual void setup_frame(Renderer &); + virtual void finish_frame(); using Scene::render; virtual void render(Renderer &, const Tag &tag = Tag()) const;