diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-02 23:38:07 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-02 23:38:07 +0200 |
commit | 238ed3cf79f616cd6aeb8d14b1e66a7c36ca6def (patch) | |
tree | 96032735c9c8445bfb9b0e2f602f5480d5dcd474 /src/window/window.c | |
parent | f2da59054cedd1c07779e72537da4d7b14616b48 (diff) |
Fix background clear color when using window transparency
Diffstat (limited to 'src/window/window.c')
-rw-r--r-- | src/window/window.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/window/window.c b/src/window/window.c index ccbf8ef..be8aa14 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -1263,13 +1263,7 @@ static void mgl_window_on_receive_event(mgl_window *self, XEvent *xev, mgl_event void mgl_window_clear(mgl_window *self, mgl_color color) { mgl_context *context = mgl_get_context(); - x11_context *x11_context = self->context; - - const float alpha = (float)color.a / 255.0f; - if(x11_context->support_alpha) - context->gl.glClearColor(((float)color.r / 255.0f) * alpha, ((float)color.g / 255.0f) * alpha, ((float)color.b / 255.0f) * alpha, alpha); - else - context->gl.glClearColor((float)color.r / 255.0f, (float)color.g / 255.0f, (float)color.b / 255.0f, alpha); + context->gl.glClearColor((float)color.r / 255.0f, (float)color.g / 255.0f, (float)color.b / 255.0f, (float)color.a / 255.0f); context->gl.glClear(GL_COLOR_BUFFER_BIT); } |