feat: batch component
This commit is contained in:
27
include/components/batch.h
Normal file
27
include/components/batch.h
Normal file
@ -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_
|
Reference in New Issue
Block a user