summaryrefslogtreecommitdiff
path: root/include/texture.h
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2020-05-20 21:29:09 -0500
committersanine-a <sanine.not@pm.me>2020-05-20 21:29:09 -0500
commitc6ec37cd355b313083af5be3435162224020fe5e (patch)
tree9a6f069812e62e97052fd6fff6bd23ac1472c756 /include/texture.h
parent040ba6826237eb124aaa4576fc302e2e07dd40c5 (diff)
add honey_texture
Diffstat (limited to 'include/texture.h')
-rw-r--r--include/texture.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/texture.h b/include/texture.h
new file mode 100644
index 0000000..ee367ba
--- /dev/null
+++ b/include/texture.h
@@ -0,0 +1,32 @@
+#ifndef HONEY_TEXTURE_H
+#define HONEY_TEXTURE_H
+
+/** @file Defines the honey_texture struct and associated functions. */
+
+#include "common.h"
+
+enum honey_texture_result {
+ TEXTURE_OK,
+ TEXTURE_FAILED,
+ N_TEXTURE_RESULTS };
+
+typedef struct {
+ unsigned int texture_id;
+ int width;
+ int height;
+ int channels;
+} honey_texture;
+
+/** @brief Load a texture from disk.
+ *
+ * @param[out] texture Pointer to the destination texture
+ * @param[in] texture_path Path to the location of the texture
+ * @param[in] alpha_channel Set to true if the target image contains an alpha channel
+ *
+ * @return Success or failure type
+ */
+enum honey_texture_result honey_texture_new(honey_texture* texture,
+ char* texture_path,
+ bool alpha_channel);
+
+#endif