diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-26 13:40:31 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-26 13:40:31 +1000 |
commit | e0a047ac1e2cf18c3b0f23f31f869eeda767503e (patch) | |
tree | a14e3eccec6e845778798fe24acc4c85f8e4da4b /src/core/core.c | |
parent | b28de1c7c87683b0645368f5393734f1db4ffd74 (diff) |
try getting glfw passthrough and egui to work
Diffstat (limited to 'src/core/core.c')
-rw-r--r-- | src/core/core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/core.c b/src/core/core.c index 38777ba..d508de8 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -20,7 +20,7 @@ Core g_core; /** @brief global `Core` that other files can use */ /** @brief Gets the global `Core` singleton */ inline Core* GetCore() { return &g_core; } -void Core_Bringup() { +void Core_Bringup(struct GLFWwindow* optional_window) { INFO("Initiate Core bringup"); memset(&g_core, 0, sizeof(Core)); @@ -31,10 +31,15 @@ void Core_Bringup() { g_core.renderer = malloc(Renderer_GetMemReqs()); // initialise all subsystems - if (!Renderer_Init(conf, g_core.renderer, &g_core.window)) { + // renderer config, renderer ptr, ptr to store a window, and optional preexisting glfw window + if (!Renderer_Init(conf, g_core.renderer, &g_core.window, optional_window)) { // FATAL("Failed to start renderer"); ERROR_EXIT("Failed to start renderer\n"); } + if (optional_window != NULL) { + g_core.window = optional_window; + } + if (!Input_Init(&g_core.input, g_core.window)) { // the input system needs the glfw window which is created by the renderer // hence the order here is important |