From a09b5a72d365f10e35b012e04b95891abf0b8313 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Wed, 20 May 2020 23:03:42 -0500 Subject: add cube primitive --- include/honey.h | 1 + include/mesh.h | 3 ++- include/primitives.h | 24 ++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 include/primitives.h (limited to 'include') diff --git a/include/honey.h b/include/honey.h index 7ae7789..bea21c4 100644 --- a/include/honey.h +++ b/include/honey.h @@ -4,6 +4,7 @@ /** @file Defines the basic loading and callback functions. */ #include "common.h" #include "mesh.h" +#include "primitives.h" #include "shader.h" #include "texture.h" diff --git a/include/mesh.h b/include/mesh.h index 2040f44..24aec26 100644 --- a/include/mesh.h +++ b/include/mesh.h @@ -1,4 +1,5 @@ -/** @brief Defines the honey_mesh struct and related basic mesh functions. */ +/** @file Defines the honey_mesh struct and related basic mesh functions. +*/ #ifndef HONEY_MESH_H #define HONEY_MESH_H diff --git a/include/primitives.h b/include/primitives.h new file mode 100644 index 0000000..81dc16f --- /dev/null +++ b/include/primitives.h @@ -0,0 +1,24 @@ +#ifndef HONEY_PRIMITIVES_H +#define HONEY_PRIMITIVES H + +/** @file Define various common primitive objects. + */ + +#include "common.h" +#include "mesh.h" + +/** @brief Create a cube. + * + * @param[out] mesh Pointer to the destination mesh + * @param[in] width Desired width of the cube (x-axis) + * @param[in] height Desired height of the cube (y-axis) + * @param[in] depth Desired depth of the cube (z-axis) + * + * @return Success or failure code + */ +enum honey_mesh_result honey_mesh_new_cube(honey_mesh* mesh, + float width, + float height, + float depth); + +#endif -- cgit v1.2.1