add ApplicationSpecification

This commit is contained in:
2025-07-09 17:41:24 +08:00
parent 9a1700ebf8
commit 7c5511aa43
2 changed files with 11 additions and 8 deletions

View File

@ -5,14 +5,14 @@
#include <SDL3/SDL_main.h> #include <SDL3/SDL_main.h>
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(); Hazel::Log::init();
HZ_PROFILE_BEGIN_SESSION("Start", "Start.json"); 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_END_SESSION();
HZ_PROFILE_BEGIN_SESSION("Update", "Update.json"); HZ_PROFILE_BEGIN_SESSION("Update", "Update.json");

View File

@ -9,20 +9,23 @@ namespace Hazel
class HazelEditor : public Application class HazelEditor : public Application
{ {
public: public:
HazelEditor() HazelEditor(const ApplicationSpecification& specification)
: Application("Hazel Editor", 1920, 1080) : Application(specification)
{ {
PushLayer(new EditorLayer()); PushLayer(new EditorLayer());
} }
~HazelEditor() = default; ~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);
} }
} }