summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2020-05-24 18:49:46 -0500
committersanine-a <sanine.not@pm.me>2020-05-24 18:49:46 -0500
commit2ca743d8df36f8cf863caa9c40f965398f72ef2e (patch)
tree9fddae310989e47e95e54fb085a818adfe1f392e /src
parentabf135246914e5ad57892fb005274da96f040fc2 (diff)
add blinn-phong lighting demo
Diffstat (limited to 'src')
-rw-r--r--src/shader.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shader.c b/src/shader.c
index e9d79a6..cba83f7 100644
--- a/src/shader.c
+++ b/src/shader.c
@@ -119,6 +119,16 @@ void honey_shader_set_vec3(honey_shader shader,
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+void honey_shader_set_mat3(honey_shader shader,
+ char* matrix_name,
+ mat3 value) {
+ glUseProgram(shader);
+ unsigned int matrix_location = glGetUniformLocation(shader, matrix_name);
+ glUniformMatrix3fv(matrix_location, 1, GL_FALSE, (float*) value);
+}
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
void honey_shader_set_mat4(honey_shader shader,
char* matrix_name,
mat4 value) {