summaryrefslogtreecommitdiffhomepage
path: root/src/shader.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader.hpp')
-rw-r--r--src/shader.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/shader.hpp b/src/shader.hpp
new file mode 100644
index 0000000..8fba3df
--- /dev/null
+++ b/src/shader.hpp
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <string>
+
+#include <glad/glad.h>
+
+class Shader
+{
+ public:
+ // id of the shader program
+ unsigned int ID;
+
+ Shader(const char* vertexPath, const char* fragmentPath);
+
+ // activate the shader
+ void use();
+
+ // utility functions for uniforms
+ void setBool(const std::string &name, bool value) const;
+ void setInt(const std::string &name, int value) const;
+ void set1f(const std::string &name, float value) const;
+ void set4f(
+ const std::string &name,
+ float value0,
+ float value1,
+ float value2,
+ float value3
+ ) const;
+};