aboutsummaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-24 13:54:14 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-24 13:54:14 +0200
commit61b2725ef174e4cec734e29bce4f69d6fcd2a813 (patch)
treeb17b0ae285976f3f6762ae470c176c04e4d63228 /src/graphics
parent17254ca13ce7985e87a413df1d8546779734f05e (diff)
Vertices: fix alpha blending when window background is transparent, add uniform for color, add position for vertices draw
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/Shader.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/graphics/Shader.cpp b/src/graphics/Shader.cpp
index 2bdc9b2..111f39d 100644
--- a/src/graphics/Shader.cpp
+++ b/src/graphics/Shader.cpp
@@ -34,6 +34,10 @@ namespace mgl {
return mgl_shader_program_set_uniform_vec2f(&shader_program, name, { value.x, value.y }) == 0;
}
+ bool Shader::set_uniform(const char *name, Color color) {
+ return mgl_shader_program_set_uniform_color(&shader_program, name, { color.r, color.g, color.b, color.a }) == 0;
+ }
+
bool Shader::is_valid() const {
return shader_program.id != 0;
}