From 28e849b3c5d683a5cdb56047189b4d73e523bbf4 Mon Sep 17 00:00:00 2001 From: kitty piapiac Date: Mon, 17 Apr 2023 14:12:51 -0700 Subject: texture loading tex.c -- load textures graph.c -- graph_shader_tex && graph_tex_create() --- tex.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tex.c (limited to 'tex.c') diff --git a/tex.c b/tex.c new file mode 100644 index 0000000..9523066 --- /dev/null +++ b/tex.c @@ -0,0 +1,10 @@ +#define STB_IMAGE_IMPLEMENTATION +#include +#include"mino.h" +#include"tex.h" +Tex tex_load(IM C*n){Tex r;U32 c; + stbi_set_flip_vertically_on_load(1); + N(r.d=stbi_load(n,(S32*)&r.w,(S32*)&r.h,(S32*)&c,3),die("failed to load texture: %s\n",stbi_failure_reason())); + R r;} + +V tex_free(Tex t){stbi_image_free(t.d);} -- cgit v1.2.3