From ec111247c614663d8231245a17c314b9b8b4a28c Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 21 Dec 2019 22:24:15 +0800 Subject: *misc --- src/core/texture.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/core/texture.h') diff --git a/src/core/texture.h b/src/core/texture.h index 9e0d884..06016ad 100644 --- a/src/core/texture.h +++ b/src/core/texture.h @@ -14,13 +14,26 @@ typedef enum { WRAPMODE_CLAMP, } WrapMode; +typedef enum { + COMPONENT_RGBA, + COMPONENT_DEPTH +} TextureComponent; + typedef struct { uint width, height; - Color32* pixels; + Color32* pixels; /*RGBA*/ + FilterMode filter_mode; + WrapMode wrap_mode; } Texture; Texture* texture_loadfromfile(const char* path); +Texture* texture_create(uint width, uint height); + +void texture_setfiltermode(Texture* tex, FilterMode filter); +void texture_setwrapmode(Texture* tex, WrapMode wrap); + +Color32 texture_sampling(Texture* tex, float x, float y); -Color32 texture_sampling(Texture* tex, FilterMode filter_mode, WrapMode wrap_mode, float x, float y); +void texture_free(Texture* tex); #endif \ No newline at end of file -- cgit v1.1-26-g67d0