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>
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");

View File

@ -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);
}
}