summaryrefslogtreecommitdiff
path: root/src/shader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader.h')
-rw-r--r--src/shader.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/shader.h b/src/shader.h
new file mode 100644
index 0000000..cd44e80
--- /dev/null
+++ b/src/shader.h
@@ -0,0 +1,17 @@
+#pragma once
+#include <glad/glad.h>
+
+typedef struct {
+ GLuint id;
+} Shader;
+
+[[nodiscard]]
+/* Return -1 on error. */
+int shader_init(Shader *s, const char *vertex_src, const char *fragment_src);
+
+void shader_deinit(Shader *s);
+
+void shader_use(const Shader *s);
+
+/* Return -1 on error. */
+GLint shader_uniform_location(const Shader *s, const char *name);