#pragma once
#include "Deer/Application.h"
#include "Deer/Log.h"

// File to define the entry point, only use once
// This makes easier to manage

extern Deer::Application* createApplication(int argc, char** argv);

namespace Deer {
	int Main(int argc, char** argv) {
		Core::argc = argc;
		Core::argv = argv;

		Log::init();
		DEER_CORE_INFO("Initializing");

		Application* app = createApplication(argc, argv);

		int runResult = app->run();
		delete app;

		DEER_CORE_INFO("Deinitializing");
		Log::shutdown();

		return runResult;
	}
}  // namespace Deer

int main(int argc, char** argv) { return Deer::Main(argc, argv); }