diff options
author | Danny Holman <dholman@gymli.org> | 2024-10-25 23:24:55 -0500 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2024-10-25 23:24:55 -0500 |
commit | cf26a0544412256b43fd8e0f3d42bab570740c77 (patch) | |
tree | a77b96c650fccef7f5437862a7b1c16ae8f5014d | |
parent | a2d2feef2595c92bbefc2357974b2c4d90fb4f93 (diff) |
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 <dholman@gymli.org>
-rw-r--r-- | core/init.c | 18 |
1 files 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 <rune/core/init.h> #include <rune/core/alloc.h> +#include <rune/core/abort.h> #include <rune/core/logging.h> -#include <rune/ui/window.h> -#include <rune/ui/renderer.h> -#include <rune/ui/input.h> +#include <rune/core/thread.h> -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(); } |