aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/graphics/texture.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mgl/graphics/texture.h')
-rw-r--r--include/mgl/graphics/texture.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/mgl/graphics/texture.h b/include/mgl/graphics/texture.h
index 9e7a423..61ac273 100644
--- a/include/mgl/graphics/texture.h
+++ b/include/mgl/graphics/texture.h
@@ -19,18 +19,28 @@ struct mgl_texture {
int width;
int height;
mgl_texture_format format;
+ int max_width;
+ int max_height;
+ bool pixel_coordinates;
};
typedef struct {
bool compressed; /* false by default */
+ bool pixel_coordinates; /* false by default, texture coordinates are normalized */
} mgl_texture_load_options;
+int mgl_texture_init(mgl_texture *self);
/* |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);
+int mgl_texture_update(mgl_texture *self, const unsigned char *data, int offset_x, int offset_y, int width, int height, mgl_image_format format);
+/* |load_options| can be null, in which case the default options are used */
+int mgl_texture_resize(mgl_texture *self, int new_width, int new_height, mgl_texture_load_options *load_options);
+/* If |texture| is NULL then no texture is used */
+void mgl_texture_use(const mgl_texture *texture);
void mgl_texture_unload(mgl_texture *self);
#endif /* MGL_TEXTURE_H */