aboutsummaryrefslogtreecommitdiff
path: root/src/graphics/vertex.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-24 13:53:06 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-24 13:53:15 +0200
commit6af3b55b9a11cf85e850eba0fddcf531e2002c7f (patch)
treea9c95a30f8b667f429a21c4379a4e455f289d315 /src/graphics/vertex.c
parente419500eafed85d4f7b184ddae75c855bdc45200 (diff)
Vertices: fix alpha blending when window background is transparent, add uniform for color
Diffstat (limited to 'src/graphics/vertex.c')
-rw-r--r--src/graphics/vertex.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/graphics/vertex.c b/src/graphics/vertex.c
index e55c180..92a6e93 100644
--- a/src/graphics/vertex.c
+++ b/src/graphics/vertex.c
@@ -1,11 +1,14 @@
#include "../../include/mgl/graphics/vertex.h"
#include "../../include/mgl/graphics/texture.h"
+#include "../../include/mgl/window/window.h"
#include "../../include/mgl/mgl.h"
void mgl_vertices_draw(mgl_context *context, const mgl_vertex *vertices, size_t vertex_count, mgl_primitive_type primitive_type, mgl_vec2f position) {
if(vertex_count == 0)
return;
+ mgl_window_set_texture_blend_func(context->current_window);
+
context->gl.glPushMatrix();
if(!mgl_texture_current_texture()) {
@@ -22,4 +25,6 @@ void mgl_vertices_draw(mgl_context *context, const mgl_vertex *vertices, size_t
context->gl.glDrawArrays(mgl_primitive_type_to_gl_mode(primitive_type), 0, vertex_count);
context->gl.glPopMatrix();
+
+ mgl_window_set_render_blend_func(context->current_window);
}