aboutsummaryrefslogtreecommitdiffstats
path: root/glprog.h
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2018-10-19 23:22:07 +0300
committerTomasz Kramkowski <tk@the-tk.com>2018-10-19 23:30:23 +0300
commit7c1edef3ac501d40e3de495b9434df71f535e9bc (patch)
treefd7f4264bdf5c30f7182a147ed9e6c7935c69bf2 /glprog.h
parent91b543a29cb8852251908a49cd120a6f7d9f2f11 (diff)
downloadfaqe-7c1edef3ac501d40e3de495b9434df71f535e9bc.tar.gz
faqe-7c1edef3ac501d40e3de495b9434df71f535e9bc.tar.xz
faqe-7c1edef3ac501d40e3de495b9434df71f535e9bc.zip
Allow multiple shaders while reducing duplication
This change also stops using bie as eventually it will be replaced with a more sophisticated asset handling system which will also allow custom shaders.
Diffstat (limited to 'glprog.h')
-rw-r--r--glprog.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/glprog.h b/glprog.h
index cd0ef83..74987b3 100644
--- a/glprog.h
+++ b/glprog.h
@@ -7,17 +7,25 @@
#include "gl.h"
-struct unidat {
- const char *name;
- GLint *loc;
+struct shader {
+ GLuint prog;
+ struct {
+#define SH_UNI(_, name) GLint name;
+#include "shaders/data.h"
+ } uni;
+ struct {
+#define SH_TEX(_, name) GLint name;
+#include "shaders/data.h"
+ } tex;
};
-struct shdrdat {
- GLuint type;
- const char *src;
- GLint len;
+struct glprog_progs {
+#define SH_PROG(name) struct shader name;
+#include "shaders/data.h"
};
-GLuint glprog_load(const struct shdrdat *shdrs, const struct unidat *unis);
+extern struct glprog_progs prog;
-#endif // SHADER_H
+void glprog_init(void);
+
+#endif // GLPROG_H