diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-24 13:53:06 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-24 13:53:15 +0200 |
commit | 6af3b55b9a11cf85e850eba0fddcf531e2002c7f (patch) | |
tree | a9c95a30f8b667f429a21c4379a4e455f289d315 /src/graphics/shader.c | |
parent | e419500eafed85d4f7b184ddae75c855bdc45200 (diff) |
Vertices: fix alpha blending when window background is transparent, add uniform for color
Diffstat (limited to 'src/graphics/shader.c')
-rw-r--r-- | src/graphics/shader.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/graphics/shader.c b/src/graphics/shader.c index f7f5545..f362490 100644 --- a/src/graphics/shader.c +++ b/src/graphics/shader.c @@ -231,6 +231,11 @@ int mgl_shader_program_set_uniform_vec4f(mgl_shader_program *self, const char *u return 0; } +int mgl_shader_program_set_uniform_color(mgl_shader_program *self, const char *uniform_name, mgl_color color) { + return mgl_shader_program_set_uniform_vec4f(self, uniform_name, + (mgl_vec4f){ color.r / 255.0f, color.g / 255.0f, color.b / 255.0f, color.a / 255.0f }); +} + /* TODO: Optimize glUseProgram */ void mgl_shader_program_use(mgl_shader_program *shader_program) { mgl_context *context = mgl_get_context(); |