diff options
| author | hachem <im@hachem.wtf> | 2026-08-20 01:57:44 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-20 02:10:49 +0200 |
| commit | 7d39ee93a6d354e727c7534a18663f1d00d46b0f (patch) | |
| tree | a188023b61d14dcb859e08e6f8f8dd30df11780f /src/core/application.cpp | |
| parent | dce67620b95a9555c7db950196b22f1bb88a307b (diff) | |
refactor: trailing return types in core
Diffstat (limited to 'src/core/application.cpp')
| -rw-r--r-- | src/core/application.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/core/application.cpp b/src/core/application.cpp index 0f07979..11c7bd0 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -53,7 +53,7 @@ namespace Donut s_instance = nullptr; } - void Application::run() + auto Application::run() -> void { while (m_running) { @@ -76,7 +76,7 @@ namespace Donut } } - void Application::build_vulkan_ui() + auto Application::build_vulkan_ui() -> void { ImGui::Begin("Donut - Vulkan backend"); ImGui::Text("Geodesic black hole through Vulkan (MoltenVK)."); @@ -87,22 +87,22 @@ namespace Donut ImGui::End(); } - void Application::close() + auto Application::close() -> void { m_running = false; } - void Application::on_event(Event& event) + auto Application::on_event(Event& event) -> void { EventDispatcher dispatcher(event); - dispatcher.dispatch<WindowCloseEvent>([this, &event](WindowCloseEvent& e) + dispatcher.dispatch<WindowCloseEvent>([this, &event](WindowCloseEvent& e) { m_running = false; event.handled = true; return true; }); - - dispatcher.dispatch<WindowResizeEvent>([this, &event](WindowResizeEvent& e) + + dispatcher.dispatch<WindowResizeEvent>([this, &event](WindowResizeEvent& e) { if (e.get_width() == 0 || e.get_height() == 0) m_minimized = true; @@ -121,7 +121,7 @@ namespace Donut event.handled = true; return true; }); - + dispatcher.dispatch<KeyPressedEvent>([this, &event](KeyPressedEvent& e) { if (!m_state_manager) @@ -144,7 +144,7 @@ namespace Donut event.handled = true; return true; } - + return true; }); @@ -152,7 +152,7 @@ namespace Donut m_state_manager->on_event(event); } - void Application::on_init() + auto Application::on_init() -> void { if (RendererAPI::get_api() == RendererAPI::API::Vulkan) { @@ -182,7 +182,7 @@ namespace Donut m_state_manager->switch_to_state("Config"); } - void Application::on_shutdown() + auto Application::on_shutdown() -> void { if (m_vulkan_renderer) { @@ -199,7 +199,7 @@ namespace Donut Logger::shutdown(); } - void Application::on_update() + auto Application::on_update() -> void { float current_frame = (float)glfwGetTime(); m_delta_time = current_frame - m_last_frame; @@ -208,20 +208,20 @@ namespace Donut m_state_manager->update(m_delta_time); } - void Application::on_render() + auto Application::on_render() -> void { m_state_manager->render(); m_window->begin_im_gui_frame(); - + ImGuizmo::BeginFrame(); ImGuizmo::SetOrthographic(false); - + setup_docking_layout(); m_state_manager->on_im_ui_render(); m_window->end_im_gui_frame(); } - - void Application::setup_docking_layout() + + auto Application::setup_docking_layout() -> void { ImGuiViewport* viewport = ImGui::GetMainViewport(); ImGui::DockSpaceOverViewport(0, viewport, ImGuiDockNodeFlags_PassthruCentralNode); |
