X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Finstancescene.h;h=a5ac2cd1c743e9fd250d5489d3e13c5902d552a7;hp=1f79d767ba0d69cbb48798a820e0f8900792b01b;hb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;hpb=9addd3d476245415244e59333a36a8fc0eae42bf diff --git a/source/instancescene.h b/source/instancescene.h index 1f79d767..a5ac2cd1 100644 --- a/source/instancescene.h +++ b/source/instancescene.h @@ -1,42 +1,35 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007-2008, 2010 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_INSTANCESCENE_H_ #define MSP_GL_INSTANCESCENE_H_ #include #include +#include #include "scene.h" 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(); - virtual void render(const Tag &tag = Tag()) const; + virtual void render(Renderer &, const Tag &tag = Tag()) const; }; } // namespace GL