aboutsummaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
Diffstat (limited to 'assets')
-rw-r--r--assets/src/gunner.h46
-rw-r--r--assets/src/main.c23
2 files changed, 66 insertions, 3 deletions
diff --git a/assets/src/gunner.h b/assets/src/gunner.h
new file mode 100644
index 0000000..cbcbe87
--- /dev/null
+++ b/assets/src/gunner.h
@@ -0,0 +1,46 @@
+#pragma once
+
+// Defines
+
+typedef struct{
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ unsigned char a;
+}Color;
+
+#define BLACK (Color){0, 0, 0, 255}
+
+// Texture
+
+void init_tex_sys(void);
+
+int load_new_tex(const char* path);
+
+void draw_texture(int idx, int x, int y);
+
+void update_textures(void);
+
+void unload_tex(int idx);
+
+void unload_active_textures(void);
+
+// Shader
+
+void init_shader_sys(void);
+
+int load_new_shader(const char* path);
+
+void set_active_shader(int idx);
+
+void update_shaders(void);
+
+void reset_active_shader(void);
+
+void unload_shader(int idx);
+
+void unload_active_shaders(void);
+
+// Text
+
+void draw_text(const char* txt, int x, int y, int size, Color col); \ No newline at end of file
diff --git a/assets/src/main.c b/assets/src/main.c
index cf4feea..08856b9 100644
--- a/assets/src/main.c
+++ b/assets/src/main.c
@@ -1,6 +1,23 @@
-int goob(void);
+#include "gunner.h"
-int test(void)
+static int femme = -1;
+static int grayscale = -1;
+
+void init(void)
+{
+ femme = load_new_tex("assets/femme.png");
+ grayscale = load_new_shader("assets/gs_full.glsl");
+}
+
+void update(void)
+{
+ draw_text("Femme my beloved!", 4, 4, 20, BLACK);
+ set_active_shader(grayscale);
+ draw_texture(femme, 32, 40);
+ reset_active_shader();
+}
+
+void exit(void)
{
- return goob();
+
} \ No newline at end of file