]> git.lizzy.rs Git - dragonblocks_alpha.git/blobdiff - src/client/mesh.h
refactoring
[dragonblocks_alpha.git] / src / client / mesh.h
index eae283f98dca30a4fb40bc00f2ac6f0c320c6144..3597043a3c02fc181ab7640c2e4f846a7d3e941f 100644 (file)
@@ -4,23 +4,29 @@
 #include <GL/glew.h>
 #include <GL/gl.h>
 #include <stdbool.h>
-#include "client/vertex.h"
 
-typedef struct
-{
-       GLuint VAO, VBO;
-       GLuint *textures;
-       GLuint textures_count;
-       bool free_textures;
-       GLvoid *vertices;
-       GLuint vertices_count;
-       bool free_vertices;
+typedef struct {
+       GLenum type;
+       GLsizei length;
+       GLsizei size;
+} VertexAttribute;
+
+typedef struct {
+       VertexAttribute *attributes;
+       GLuint count;
+       GLsizei size;
+} VertexLayout;
+
+typedef struct {
        VertexLayout *layout;
+       GLuint vao, vbo;
+       GLvoid *data;
+       GLuint count;
+       bool free_data;
 } Mesh;
 
-Mesh *mesh_create();
-void mesh_delete(Mesh *mesh);
-void mesh_configure(Mesh *mesh);
+void mesh_upload(Mesh *mesh);
 void mesh_render(Mesh *mesh);
+void mesh_destroy(Mesh *mesh);
 
-#endif
+#endif // _MESH_H_