#ifndef MGL_TEXTURE_H #define MGL_TEXTURE_H #include "image.h" #include typedef struct mgl_texture mgl_texture; typedef enum { MGL_TEXTURE_FORMAT_ALPHA, MGL_TEXTURE_FORMAT_GRAY, MGL_TEXTURE_FORMAT_GRAY_ALPHA, MGL_TEXTURE_FORMAT_RGB, MGL_TEXTURE_FORMAT_RGBA } mgl_texture_format; struct mgl_texture { unsigned int id; int width; int height; mgl_texture_format format; }; typedef struct { bool compressed; /* false by default */ } mgl_texture_load_options; /* |load_options| can be null, in which case the default options are used */ int mgl_texture_load_from_file(mgl_texture *self, const char *filepath, mgl_texture_load_options *load_options); /* |load_options| can be null, in which case the default options are used */ int mgl_texture_load_from_image(mgl_texture *self, const mgl_image *image, mgl_texture_load_options *load_options); /* |load_options| can be null, in which case the default options are used */ int mgl_texture_load_from_memory(mgl_texture *self, const unsigned char *data, int width, int height, mgl_image_format format, mgl_texture_load_options *load_options); void mgl_texture_unload(mgl_texture *self); #endif /* MGL_TEXTURE_H */