From e2b369bf31cb52d1d0a3e400ce0530064cef96ad Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Thu, 22 May 2025 19:20:01 +0200 Subject: Change colors --- src/main/engine/engine.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/main/engine/engine.c') diff --git a/src/main/engine/engine.c b/src/main/engine/engine.c index 495b960..d9477cc 100644 --- a/src/main/engine/engine.c +++ b/src/main/engine/engine.c @@ -95,15 +95,22 @@ engine_calculate_fps() } } +static void +engine_set_background(Engine *engine) +{ + if (engine == NULL || engine->rendering_background == NULL) return; + Color *bk = engine->rendering_background; + glClearColor(bk->r, bk->g, bk->b, bk->a); +} + static void draw_frames(void *data) { if (data == NULL) return; Engine *engine = data; - Color *bk = engine->rendering_background; - glClearColor(bk->r, bk->g, bk->b, bk->a); + engine_set_background(engine); glClear(GL_COLOR_BUFFER_BIT); glEnable(GL_LINE_SMOOTH); glEnable(GL_BLEND); -- cgit v1.2.3