diff options
author | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2024-02-07 22:49:00 +0100 |
---|---|---|
committer | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2024-02-07 22:49:00 +0100 |
commit | 35a70d71f62e41d78d68247075ce174f2b6d997a (patch) | |
tree | c9af8d8c44256abfc100c396182fd27f1f4c7263 /include/render/mesh.h |
inital commit -- THE CUBES SPIN
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'include/render/mesh.h')
-rw-r--r-- | include/render/mesh.h | 43 |
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 |