summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2020-05-21 10:16:59 -0500
committersanine-a <sanine.not@pm.me>2020-05-21 10:16:59 -0500
commit8b7e8a1a3e77b4e3b56ea9025af8b254faa16c13 (patch)
tree3f39bb785d5f1df1f026589a6cc1aa2749e30e6d /include
parent9b66b322b600ab0db66cb6f3ff5a7c4196b9193f (diff)
add textured cube primitive
Diffstat (limited to 'include')
-rw-r--r--include/primitives.h18
-rw-r--r--include/texture.h7
2 files changed, 25 insertions, 0 deletions
diff --git a/include/primitives.h b/include/primitives.h
index bfa944d..a7e4ccb 100644
--- a/include/primitives.h
+++ b/include/primitives.h
@@ -11,6 +11,8 @@
/** @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)
* @param[in] height Desired height of the cube (y-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