refactor: convert engine to a singleton

This commit is contained in:
Trianta 2024-08-02 19:50:48 -05:00
parent 0ff3ef3f62
commit b9b771bc1c
2 changed files with 11 additions and 8 deletions

View File

@ -39,4 +39,6 @@ private:
double average = 0; double average = 0;
}; };
inline std::unique_ptr<GameEngine> g_pEngine;
#endif #endif

View File

@ -1,8 +1,9 @@
#include "gamestate.hpp" #include "gamestate.hpp"
#include <memory>
int main(void) int main(void)
{ {
GameEngine game; g_pEngine = std::make_unique<GameEngine>();
game.Start(); g_pEngine->Start();
return 0; return 0;
} }