Khaotic Engine Reborn
Loading...
Searching...
No Matches
Main.cpp
1#include "system_class.h"
2
3
4int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
5{
6 system_class* System;
7 bool result;
8
9 wchar_t path[MAX_PATH];
10 HMODULE hmodule = GetModuleHandle(NULL);
11 if (hmodule != NULL)
12 {
13 GetModuleFileName(hmodule, path, (sizeof(path) / sizeof(wchar_t)));
14 }
15
16 std::filesystem::path exePath(path);
17 std::filesystem::path WFolder = exePath.parent_path();
18
19 // Create the system object.
20 System = new system_class;
21
22 // initialize and run the system object.
23 result = System->initialize();
24 if (result)
25 {
26 Logger::Get().Log("System initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
27 System->send_path(path,WFolder);
28 System->run();
29 }
30
31 // shutdown and release the system object.
32 System->shutdown();
33 delete System;
34 System = 0;
35
36 return 0;
37}
static Logger & Get()
Definition Logger.h:20
void Log(const std::string &message, const std::string &fileName, int lineNumber, LogLevel level=LogLevel::Info)
Definition Logger.h:158