diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2018-10-19 23:22:07 +0300 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2018-10-19 23:30:23 +0300 |
commit | 7c1edef3ac501d40e3de495b9434df71f535e9bc (patch) | |
tree | fd7f4264bdf5c30f7182a147ed9e6c7935c69bf2 /glprog.h | |
parent | 91b543a29cb8852251908a49cd120a6f7d9f2f11 (diff) | |
download | faqe-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.h | 26 |
1 files changed, 17 insertions, 9 deletions
@@ -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 |