]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/client/mesh.h
3597043a3c02fc181ab7640c2e4f846a7d3e941f
[dragonblocks_alpha.git] / src / client / mesh.h
1 #ifndef _MESH_H_
2 #define _MESH_H_
3
4 #include <GL/glew.h>
5 #include <GL/gl.h>
6 #include <stdbool.h>
7
8 typedef struct {
9         GLenum type;
10         GLsizei length;
11         GLsizei size;
12 } VertexAttribute;
13
14 typedef struct {
15         VertexAttribute *attributes;
16         GLuint count;
17         GLsizei size;
18 } VertexLayout;
19
20 typedef struct {
21         VertexLayout *layout;
22         GLuint vao, vbo;
23         GLvoid *data;
24         GLuint count;
25         bool free_data;
26 } Mesh;
27
28 void mesh_upload(Mesh *mesh);
29 void mesh_render(Mesh *mesh);
30 void mesh_destroy(Mesh *mesh);
31
32 #endif // _MESH_H_