diff options
author | sanine-a <sanine.not@pm.me> | 2020-05-24 18:49:46 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-05-24 18:49:46 -0500 |
commit | 2ca743d8df36f8cf863caa9c40f965398f72ef2e (patch) | |
tree | 9fddae310989e47e95e54fb085a818adfe1f392e /src | |
parent | abf135246914e5ad57892fb005274da96f040fc2 (diff) |
add blinn-phong lighting demo
Diffstat (limited to 'src')
-rw-r--r-- | src/shader.c | 10 |
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) { |