From cf26a0544412256b43fd8e0f3d42bab570740c77 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Fri, 25 Oct 2024 23:24:55 -0500 Subject: core: rune_init should only call subsystem inits The main engine initialization function should only call up background subsystem init functions. No window or rendering context should be created inside this function. Likewise, the cleanup function calls should be removed from rune_exit. Signed-off-by: Danny Holman --- core/init.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/core/init.c b/core/init.c index e56a1ec..96fee70 100644 --- a/core/init.c +++ b/core/init.c @@ -1,23 +1,17 @@ #include #include +#include #include -#include -#include -#include +#include -static struct rune_window *window; -static struct rune_renderer *renderer; - -struct rune_window* rune_init(uint32_t width, uint32_t height, const char *title) { +int rune_init(int argc, char* argv[]) { + enable_log_color(); log_output(LOG_INFO, "Started Rune Engine version %s", VERSION); - window = rune_create_window(width, height, title); - rune_input_init(window); - renderer = rune_create_renderer(window, RUNE_RENDERER_VULKAN); + rune_init_thread_api(); + return 0; } void rune_exit(void) { log_output(LOG_INFO, "Engine shutdown requested"); - rune_destroy_renderer(renderer); - rune_destroy_window(window); rune_free_all(); } -- cgit v1.2.3