]> git.tdb.fi Git - libs/gl.git/blobdiff - source/batch.cpp
Let Batch decide whether appending is possible
[libs/gl.git] / source / batch.cpp
index 3f7bffee901da3bfab572e197a44da13ff912741..8807b2c539c983e61de11628627d5b6392986b7c 100644 (file)
@@ -117,6 +117,16 @@ void Batch::append(const vector<unsigned> &ind)
        dirty = true;
 }
 
+bool Batch::can_append(PrimitiveType other_type)
+{
+       if(other_type!=prim_type)
+               return false;
+       else if(prim_type==LINE_STRIP || prim_type==LINE_LOOP || prim_type==TRIANGLE_FAN || prim_type==POLYGON)
+               return NV_primitive_restart;
+       else
+               return true;
+}
+
 void Batch::append(const Batch &other)
 {
        if(other.prim_type!=prim_type)