-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (27 loc) · 740 Bytes
/
main.cpp
File metadata and controls
35 lines (27 loc) · 740 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
33
34
35
#include "src/engine/will_engine.h"
#include <spdlog/spdlog.h>
#include "platform/crash_handler.h"
#include "platform/paths.h"
#include "utils/logging/logging.h"
#include <SDL3/SDL_main.h>
int main(int argc, char* argv[])
{
Platform::CrashHandler crashHandler(Platform::GetCrashPath());
Utils::Logger* _logger = nullptr;
#if LOGGING_ENABLED
Utils::Logger logger(Platform::GetLogPath() / "engine.log");
SPDLOG_INFO("Engine starting...");
crashHandler.SetLogPath(logger.GetLogPath());
_logger = &logger;
#endif
{
Engine::WillEngine we{&crashHandler};
we.Initialize(_logger);
we.Run();
we.Cleanup();
}
#if LOGGING_ENABLED
logger.ArchiveLogs();
#endif
return 0;
}