From 5b361d81dbd2af0d0e99b9eb1adebea76ff05db0 Mon Sep 17 00:00:00 2001 From: hachem Date: Thu, 20 Aug 2026 02:27:02 +0200 Subject: [chore]: MASSIVE refactor + more vulkan bs --- src/core/application.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/core/application.h (limited to 'src/core/application.h') diff --git a/src/core/application.h b/src/core/application.h new file mode 100644 index 0000000..06c4e94 --- /dev/null +++ b/src/core/application.h @@ -0,0 +1,53 @@ +#pragma once + +#include "state_manager.h" +#include "memory.h" +#include "window.h" +#include "event.h" +#include "log.h" + +#include "engine/engine.h" + +namespace Donut +{ + class VulkanRenderer; // live-window Vulkan backend (platform/vulkan) + + class Application + { + public: + Application(const std::string& name = "Donut", + int width = 1280, int height = 720); + ~Application(); + + auto run() -> void; + auto close() -> void; + + auto get_window() -> Window& { return *m_window; } + auto get_state_manager() -> StateManager& { return *m_state_manager; } + auto get_engine() -> Engine& { return *m_engine; } + static auto get() -> Application& { return *s_instance; } + + private: + auto on_init() -> void; + auto on_shutdown() -> void; + auto on_update() -> void; + auto on_render() -> void; + auto on_event(Event& event) -> void; + auto setup_docking_layout() -> void; + auto build_vulkan_ui() -> void; // ImGui UI built each frame on the Vulkan path + + private: + Scope m_state_manager; + Scope m_window; + Scope m_engine; + Scope m_vulkan_renderer; // non-null only when the Vulkan API is selected + + bool m_running; + bool m_minimized; + + float m_delta_time = 0.0f; + float m_last_frame = 0.0f; + + static Application* s_instance; + }; +} -- cgit v1.3