]> git.tdb.fi Git - libs/gl.git/blobdiff - source/instancescene.h
Generalize instancing to all Renderables
[libs/gl.git] / source / instancescene.h
index 55bd266d7afbd80ea77dabbb725b620b14b7c1de..18229d72cc59b59a43408c6bd2e6dd9de1decdb3 100644 (file)
@@ -15,22 +15,18 @@ 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<const ObjectInstance *> InstanceSet;
-       typedef std::map<const Object *, InstanceSet> ObjectMap;
        typedef std::set<const Renderable *> RenderableSet;
+       typedef std::map<long, RenderableSet> InstanceMap;
 
-       ObjectMap objects;
-       RenderableSet renderables;
+       InstanceMap renderables;
 
 public:
        virtual void add(const Renderable &);