From 6f72049359651155be62846e7d080d7a5e871096 Mon Sep 17 00:00:00 2001 From: hachem Date: Thu, 21 Aug 2025 19:08:34 +0200 Subject: [fix]: proper scene loading --- src/Core/Application.cpp | 4 ++++ src/Core/Application.h | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/Core') diff --git a/src/Core/Application.cpp b/src/Core/Application.cpp index 62f1faa..eefa482 100644 --- a/src/Core/Application.cpp +++ b/src/Core/Application.cpp @@ -71,6 +71,7 @@ namespace Donut m_Minimized = false; Renderer::OnWindowResize(e.GetWidth(), e.GetHeight()); + m_Engine->SetWindowDimensions(e.GetWidth(), e.GetHeight()); event.Handled = true; return true; }); @@ -118,6 +119,9 @@ namespace Donut Renderer::OnWindowResize(1280, 720); RenderCommand::SetFaceCulling(false); + m_Engine = CreateScope(); + m_Engine->SetWindowDimensions(1280, 720); + m_StateManager = CreateScope(); m_StateManager->RegisterState("Config", CreateScope()); m_StateManager->RegisterState("Simulation", CreateScope()); diff --git a/src/Core/Application.h b/src/Core/Application.h index c882bf6..c16b6d9 100644 --- a/src/Core/Application.h +++ b/src/Core/Application.h @@ -1,10 +1,12 @@ #pragma once +#include "StateManager.h" #include "Memory.h" #include "Window.h" #include "Event.h" #include "Log.h" -#include "StateManager.h" + +#include "Engine/Engine.h" namespace Donut { @@ -18,9 +20,10 @@ namespace Donut void Run(); void Close(); - Window& GetWindow() { return *m_Window; } + Window& GetWindow() { return *m_Window; } StateManager& GetStateManager() { return *m_StateManager; } - static Application& Get() { return *s_Instance; } + Engine& GetEngine() { return *m_Engine; } + static Application& Get() { return *s_Instance; } private: void OnInit(); void OnShutdown(); @@ -31,6 +34,7 @@ namespace Donut private: Scope m_StateManager; Scope m_Window; + Scope m_Engine; bool m_Running; bool m_Minimized; -- cgit v1.3