summaryrefslogtreecommitdiff
path: root/include/render/mesh.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/render/mesh.h')
-rw-r--r--include/render/mesh.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/render/mesh.h b/include/render/mesh.h
new file mode 100644
index 0000000..aed4836
--- /dev/null
+++ b/include/render/mesh.h
@@ -0,0 +1,43 @@
+#ifndef _RENDER_MESH_H_
+#define _RENDER_MESH_H_
+
+#include <vulkan/vulkan.h>
+#include <stdint.h>
+#include "render/buffer.h"
+
+#include "linmath.h"
+
+struct renderer;
+
+struct vec3 {
+ float x, y, z;
+};
+
+struct vec4 {
+ float x, y, z, w;
+};
+
+struct ubo {
+ mat4x4 model;
+ mat4x4 view;
+ mat4x4 proj;
+};
+
+struct vertex {
+ struct vec3 position;
+ struct vec3 normal;
+ struct vec4 color;
+};
+
+struct mesh {
+ struct buffer vertex;
+ struct buffer index;
+ mat4x4 position;
+ size_t index_count;
+};
+
+struct mesh upload_mesh(struct renderer *ren, size_t vertex_count, struct vertex vertices[vertex_count],
+ size_t index_count, uint32_t indices[index_count], struct vec3 position);
+void mesh_destroy(struct renderer *ren, struct mesh *mesh);
+
+#endif