summaryrefslogtreecommitdiff
path: root/micro/tex.h
diff options
context:
space:
mode:
Diffstat (limited to 'micro/tex.h')
-rw-r--r--micro/tex.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/micro/tex.h b/micro/tex.h
new file mode 100644
index 0000000..3e58817
--- /dev/null
+++ b/micro/tex.h
@@ -0,0 +1,37 @@
+#ifndef __MICRO_TEX_H__
+#define __MICRO_TEX_H__
+
+#include "common.h"
+
+struct renderer;
+
+struct texture {
+ u32 handle;
+ int width;
+ int height;
+};
+
+struct render_texture {
+ u32 handle;
+ struct texture color;
+ struct texture depth;
+ // struct texture stencil; TODO
+
+ int width;
+ int height;
+};
+
+struct texture load_texture(const char *file_path);
+struct texture load_texture_from_mem(u8 *data, int width, int height);
+void free_texture(struct texture tex);
+
+bool is_texture_init(struct texture tex);
+
+struct render_texture create_render_texture(
+ int width,
+ int height,
+ bool add_depth
+);
+void free_render_texture(struct render_texture rtex);
+
+#endif // __MICRO_TEX_H__