aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-01-14 14:25:15 +0100
committerdec05eba <dec05eba@protonmail.com>2023-01-14 14:25:15 +0100
commit1ad975ac730a28b3c1a4fb4c2d0abc387e18d3f6 (patch)
tree195ff9c9a5cece0b8daacd301f448ff766f9f3ba
parent8278c7a20dc3845f63abccd13375f2805d9b69e8 (diff)
Set clear color before clear, fixes black background on first frame
-rw-r--r--src/window/window.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/window/window.c b/src/window/window.c
index d12034f..660ae9d 100644
--- a/src/window/window.c
+++ b/src/window/window.c
@@ -817,8 +817,8 @@ 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();
- context->gl.glClear(GL_COLOR_BUFFER_BIT);
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);
}
bool mgl_window_poll_event(mgl_window *self, mgl_event *event) {