diff options
Diffstat (limited to 'src/texture/texture.h')
-rw-r--r-- | src/texture/texture.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/texture/texture.h b/src/texture/texture.h new file mode 100644 index 0000000..037d3d0 --- /dev/null +++ b/src/texture/texture.h @@ -0,0 +1,42 @@ +#ifndef HONEY_TEXTURE_H +#define HONEY_TEXTURE_H + +/** @file texture.h + * + *@brief 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); + +/** @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 |