Chunks meshes indexing

This commit is contained in:
@clasher113
2023-11-20 09:16:07 +02:00
parent 45d90cc693
commit cd3cf70710
4 changed files with 111 additions and 81 deletions
+6 -2
View File
@@ -11,13 +11,17 @@ struct vattr {
class Mesh {
unsigned int vao;
unsigned int vbo;
unsigned int ibo;
size_t vertices;
size_t indices;
size_t vertexSize;
public:
Mesh(const float* buffer, size_t vertices, const vattr* attrs);
Mesh(const float* vertexBuffer, size_t vertices, const int* indexBuffer, size_t indices, const vattr* attrs);
Mesh(const float* vertexBuffer, size_t vertices, const vattr* attrs) :
Mesh(vertexBuffer, vertices, nullptr, 0, attrs) {};
~Mesh();
void reload(const float* buffer, size_t vertices);
void reload(const float* vertexBuffer, size_t vertices, const int* indexBuffer = nullptr, size_t indices = 0);
void draw(unsigned int primitive);
void draw();