From 4757ba8e589658ebdfe6796d8a7226d0d82aa1c3 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 16 Oct 2025 14:03:12 +0200 Subject: [PATCH] feat: batch component --- include/components/batch.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/components/batch.h diff --git a/include/components/batch.h b/include/components/batch.h new file mode 100644 index 0000000..55f11a6 --- /dev/null +++ b/include/components/batch.h @@ -0,0 +1,27 @@ +#ifndef COMPONENT_BATCH_H_ +#define COMPONENT_BATCH_H_ + +#include "renderer/renderer.h" + +// requires mesh component +struct batch { + friend class Renderer; +public: + // requires transform component + struct item { + unsigned int batchId; + }; + + batch(); + + inline const unsigned int id() const { return m_id; } +protected: + static unsigned int LastID; +private: + unsigned int m_id; + unsigned int m_instance_vbo { 0 }; +private: + void prepare(glm::mat4 *instances, unsigned int count); +}; + +#endif // COMPONENT_BATCH_H_ \ No newline at end of file