diff options
Diffstat (limited to 'src/main/engine/engine.c')
-rw-r--r-- | src/main/engine/engine.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/engine/engine.c b/src/main/engine/engine.c index 5ea4c4f..97ba445 100644 --- a/src/main/engine/engine.c +++ b/src/main/engine/engine.c @@ -79,6 +79,7 @@ engine_new(int w, int h) exit(EXIT_FAILURE); } engine->circles = list_create(); + engine_set_rendering_background(engine, 0.0f, 0.0f, 0.2f, 1.0f); width = w; height = h; @@ -200,7 +201,9 @@ draw_circles() static void draw_frames() { - glClearColor(0.0f, 0.0f, 0.2f, 1.0f); + Color *bk = engine->rendering_background; + + glClearColor(bk->r, bk->g, bk->b, bk->a); glClear(GL_COLOR_BUFFER_BIT); glEnable(GL_LINE_SMOOTH); glEnable(GL_BLEND); @@ -309,3 +312,13 @@ engine_input(void (*f_input)(int engine_input)) ui_set_generic_listener(engine_dispatch_ui_events); dispatch_ui_event = f_input; } + +void +engine_set_rendering_background(Engine *engine, float r, float g, float b, float a) +{ + if (engine->rendering_background == NULL) { + engine->rendering_background = color_new(r, g, b, a); + } else { + color_set_rgba(engine->rendering_background, r, g, b, a); + } +} |