-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (28 loc) · 833 Bytes
/
main.cpp
File metadata and controls
32 lines (28 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "Core/App/Application.h"
#include "Core/App/FatalErrorReport.h"
#include "Game/MainMenu/MainMenuGame.h"
#include <Windows.h>
#include <exception>
#include <memory>
int main()
{
try
{
HINSTANCE__ *const hInstance = GetModuleHandleW(nullptr);
ApplicationDesc applicationDescription{};
applicationDescription.Title = L"Mini Engine";
Application app(hInstance, std::make_unique<MainMenuGame>(), applicationDescription);
return app.Run();
}
catch (const std::exception &exception)
{
const std::string message = std::string("Fatal error:\n") + exception.what();
FatalErrorReport::Report(message);
return -1;
}
catch (...)
{
FatalErrorReport::Report("Unknown fatal error (non-std::exception).");
return -1;
}
}