summaryrefslogtreecommitdiffstats
path: root/src/game/client/program.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client/program.hh')
-rw-r--r--src/game/client/program.hh34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/game/client/program.hh b/src/game/client/program.hh
new file mode 100644
index 0000000..af78513
--- /dev/null
+++ b/src/game/client/program.hh
@@ -0,0 +1,34 @@
+#pragma once
+
+struct GL_VariedMacro final {
+ std::string name;
+ unsigned long line;
+ unsigned int value;
+};
+
+struct GL_Uniform final {
+ std::string name;
+ GLint location;
+};
+
+class GL_Program final {
+public:
+ bool setup(std::string_view vpath, std::string_view fpath);
+ void destroy(void);
+ bool update(void);
+
+ std::size_t add_uniform(std::string_view name);
+ void set_variant_vert(unsigned int variant, unsigned int value);
+ void set_variant_frag(unsigned int variant, unsigned int value);
+
+public:
+ std::string vert_path;
+ std::string frag_path;
+ std::vector<std::string> vert_source;
+ std::vector<std::string> frag_source;
+ std::vector<GL_VariedMacro> vert_variants;
+ std::vector<GL_VariedMacro> frag_variants;
+ std::vector<GL_Uniform> uniforms;
+ bool needs_update;
+ GLuint handle;
+};