From 7c5511aa430e6da0e720fcff7111b22a0d1c6158 Mon Sep 17 00:00:00 2001 From: Atdunbg <979541498@qq.com> Date: Wed, 9 Jul 2025 17:41:24 +0800 Subject: [PATCH] add ApplicationSpecification --- Hazel/src/Hazel/Core/EntryPoint.h | 6 +++--- Sandbox/src/SandboxApp.cpp | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Hazel/src/Hazel/Core/EntryPoint.h b/Hazel/src/Hazel/Core/EntryPoint.h index 7e7ade8..e0f5e9b 100644 --- a/Hazel/src/Hazel/Core/EntryPoint.h +++ b/Hazel/src/Hazel/Core/EntryPoint.h @@ -5,14 +5,14 @@ #include -extern Hazel::Application* Hazel::CreateApplication(); +extern Hazel::Application* Hazel::CreateApplication(ApplicationCommandLineArgs args); -int main(int, char**) { +int main(int argc, char** argv) { Hazel::Log::init(); HZ_PROFILE_BEGIN_SESSION("Start", "Start.json"); - const auto app = Hazel::CreateApplication(); + const auto app = Hazel::CreateApplication({argc, argv}); HZ_PROFILE_END_SESSION(); HZ_PROFILE_BEGIN_SESSION("Update", "Update.json"); diff --git a/Sandbox/src/SandboxApp.cpp b/Sandbox/src/SandboxApp.cpp index 9712da3..9698563 100644 --- a/Sandbox/src/SandboxApp.cpp +++ b/Sandbox/src/SandboxApp.cpp @@ -9,20 +9,23 @@ namespace Hazel class HazelEditor : public Application { public: - HazelEditor() - : Application("Hazel Editor", 1920, 1080) + HazelEditor(const ApplicationSpecification& specification) + : Application(specification) { PushLayer(new EditorLayer()); } ~HazelEditor() = default; - private: }; - Application* CreateApplication() + Application* CreateApplication(ApplicationCommandLineArgs args) { - return new HazelEditor(); + ApplicationSpecification spec; + spec.name = "Editor app"; + spec.commandLineArgs = args; + + return new HazelEditor(spec); } }