From 41fa908dc15b522e53946a716f4f6c00520bd46f Mon Sep 17 00:00:00 2001 From: sanine-a Date: Mon, 19 Oct 2020 05:35:06 -0500 Subject: add honey libraries back and reorganize directories --- src/mesh/mesh.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/mesh/mesh.h | 57 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 src/mesh/mesh.c create mode 100644 src/mesh/mesh.h (limited to 'src/mesh') diff --git a/src/mesh/mesh.c b/src/mesh/mesh.c new file mode 100644 index 0000000..231fcc9 --- /dev/null +++ b/src/mesh/mesh.c @@ -0,0 +1,86 @@ +#include "mesh.h" + +honey_result honey_mesh_new(honey_mesh* mesh, + float* vertices, + unsigned int n_vertices, + unsigned int n_attributes, + unsigned int* attribute_sizes, + unsigned int* indices, + unsigned int n_indices) { + if (vertices == NULL || n_vertices == 0) { + return HONEY_MESH_BAD_VERTEX_DATA; + } + if (indices == NULL || n_indices == 0) { + return HONEY_MESH_BAD_INDEX_DATA; + } + + unsigned int vertex_size = 0; + for (int i=0; i