From 8b7e8a1a3e77b4e3b56ea9025af8b254faa16c13 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Thu, 21 May 2020 10:16:59 -0500 Subject: add textured cube primitive --- include/primitives.h | 18 ++++++++++++++++++ include/texture.h | 7 +++++++ 2 files changed, 25 insertions(+) (limited to 'include') diff --git a/include/primitives.h b/include/primitives.h index bfa944d..a7e4ccb 100644 --- a/include/primitives.h +++ b/include/primitives.h @@ -10,6 +10,8 @@ #include "mesh.h" /** @brief Create a cube. + * + * This function creates a cube with vertex positions in attribute 0. * * @param[out] mesh Pointer to the destination mesh * @param[in] width Desired width of the cube (x-axis) @@ -22,5 +24,21 @@ enum honey_mesh_result honey_mesh_new_cube(honey_mesh* mesh, float width, float height, float depth); +/** @brief Create a textured cube. + * + * This function creates a cube with vertex positions in attribute 0, + * and texture coordinates in attribute 1. + * + * @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_textured_cube(honey_mesh* mesh, + float width, + float height, + float depth); #endif diff --git a/include/texture.h b/include/texture.h index e773e62..4caeebf 100644 --- a/include/texture.h +++ b/include/texture.h @@ -32,4 +32,11 @@ enum honey_texture_result honey_texture_new(honey_texture* texture, char* texture_path, bool alpha_channel); +/** @brief Load a texture into a texture unit. + * + * @param[in] texture The texture to use + * @param[in] texture_unit The texture unit to put the texture in + */ +void honey_texture_use(honey_texture texture, int texture_unit); + #endif -- cgit v1.2.1