From 0d5743ae8a077c284c0cad2e3f9dc52c6eed0a40 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 27 Dec 2024 21:02:43 +0100 Subject: Use correct alpha blending for transparent window --- src/window/window.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src/window/window.c') diff --git a/src/window/window.c b/src/window/window.c index dd91110..d931a9f 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -1017,7 +1017,7 @@ static int mgl_window_init(mgl_window *self, const char *title, const mgl_window context->gl.glEnable(GL_TEXTURE_2D); context->gl.glEnable(GL_BLEND); context->gl.glEnable(GL_SCISSOR_TEST); - mgl_window_set_render_blend_func(self); + context->gl.glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); context->gl.glEnableClientState(GL_VERTEX_ARRAY); context->gl.glEnableClientState(GL_TEXTURE_COORD_ARRAY); context->gl.glEnableClientState(GL_COLOR_ARRAY); @@ -2120,17 +2120,6 @@ void mgl_window_set_key_repeat_enabled(mgl_window *self, bool enabled) { self->key_repeat_enabled = enabled; } -void mgl_window_set_texture_blend_func(mgl_window *self) { - mgl_context *context = mgl_get_context(); - context->gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -} - -void mgl_window_set_render_blend_func(mgl_window *self) { - mgl_context *context = mgl_get_context(); - x11_context *x11_context = self->context; - context->gl.glBlendFunc(x11_context->support_alpha ? GL_ONE : GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -} - void mgl_window_flush(mgl_window *self) { mgl_context *context = mgl_get_context(); XFlush(context->connection); -- cgit v1.2.3