]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/instancearray.h
Update and improve documentation
[libs/gl.git] / source / render / instancearray.h
index 0965499fe66f98de6268619a189f80d253d91800..d793ce2ed229cd8159ac9fc2504c9c1d0472a854 100644 (file)
@@ -15,10 +15,14 @@ class Object;
 class ObjectInstance;
 
 /**
-Renders multiple instances of an Object in an efficient manner.  If instanced
-rendering is supported, only one draw call per Batch needs to be issued.
+Renders multiple instances of an Object in an efficient manner.
 
-Changing the Mesh of the Object while an InstanceArray exists is not supported.
+The instance specific transform is passed to the shader in an attribute with
+the name instance_transform.  The attribute should have the type vec4[3].  Each
+elements of the array corresponds to a row of the transform matrix.
+
+If the Mesh or Technique of the Object is changed during the lifetime of the
+InstanceArray, behaviour is undefined.
 */
 class InstanceArray: public Renderable
 {
@@ -51,6 +55,8 @@ public:
 
        void set_matrix_attribute(const std::string &);
 
+       /** Adds a new instance to the array.  The instance class must have a
+       constructor taking a const reference to Object as its sole parameter. */
        template<typename T = ObjectInstance>
        T &append();
 private: