summaryrefslogtreecommitdiff
path: root/src/shader.h
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-12-04 13:16:21 -0500
committerFreya Murphy <freya@freyacat.org>2025-12-04 13:18:33 -0500
commitba2f810f0752bdecf8253b34bd245c7939f23534 (patch)
tree23a5fa60afb7f9f5d0ff1b51d11bb8dd24f46e04 /src/shader.h
downloadvoxel-ba2f810f0752bdecf8253b34bd245c7939f23534.tar.gz
voxel-ba2f810f0752bdecf8253b34bd245c7939f23534.tar.bz2
voxel-ba2f810f0752bdecf8253b34bd245c7939f23534.zip
initial chunk rendering
Diffstat (limited to 'src/shader.h')
-rw-r--r--src/shader.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/shader.h b/src/shader.h
new file mode 100644
index 0000000..931dd33
--- /dev/null
+++ b/src/shader.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <GL/gl.h>
+#include <cglm/cglm.h>
+
+typedef struct {
+ GLuint program_id;
+ GLuint vertex_id;
+ GLuint fragment_id;
+ int attributes;
+} Shader;
+
+Shader *shader_init(const char *vertexFile, const char *fragmentFile);
+void shader_bind(Shader *shader);
+void shader_unbind(void);
+void shader_free(Shader *shader);
+
+GLint shader_uniform_location(Shader *shader, const char *name);
+void shader_loadf(GLint location, float value);
+void shader_loadi(GLint location, int value);
+void shader_loadv3f(GLint location, vec3 value);
+void shader_loadm4f(GLint location, mat4 value);