X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fbatch.h;h=2ac2c43c17f1eeb26c75626c2efd4064bf3d4880;hb=HEAD;hp=1fc225210f739a457278b7e5f6ba3ba87e62b4da;hpb=99ca354f18119f82f1adeca100cd665a8f640317;p=libs%2Fgl.git diff --git a/source/core/batch.h b/source/core/batch.h index 1fc22521..2ac2c43c 100644 --- a/source/core/batch.h +++ b/source/core/batch.h @@ -30,13 +30,15 @@ public: Loader(Batch &); private: void indices(const std::vector &); + void patch_size(unsigned); }; private: PrimitiveType prim_type; DataType index_type; std::vector data; - unsigned max_index; + unsigned max_index = 0; + unsigned patch_size = 3; public: Batch(PrimitiveType); @@ -50,6 +52,12 @@ public: DataType get_index_type() const { return index_type; } + /** Sets the number of control points per patch. Only available if the + primitive type is PATCHES. */ + void set_patch_size(unsigned); + + unsigned get_patch_size() const { return patch_size; } + /** Appends a single index. The data type is automatically adjusted if the index is too large for the current data type. */ Batch &append(unsigned);