summaryrefslogtreecommitdiff
path: root/tex.c
diff options
context:
space:
mode:
authorkitty piapiac <kcp@bsd.computer>2023-04-17 14:12:51 -0700
committerkitty piapiac <kcp@bsd.computer>2023-04-17 14:12:51 -0700
commit28e849b3c5d683a5cdb56047189b4d73e523bbf4 (patch)
tree37168540deb94234749e3b1e4ffec868ea0b72b6 /tex.c
parent8ad89fb13af5ffaec52e196f1874d18ec129031c (diff)
texture loading
tex.c -- load textures graph.c -- graph_shader_tex && graph_tex_create()
Diffstat (limited to 'tex.c')
-rw-r--r--tex.c10
1 files changed, 10 insertions, 0 deletions
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<stb/stb_image.h>
+#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);}