refactor: convert engine to a singleton
This commit is contained in:
		
							parent
							
								
									0ff3ef3f62
								
							
						
					
					
						commit
						b9b771bc1c
					
				@ -39,4 +39,6 @@ private:
 | 
			
		||||
    double average = 0;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
inline std::unique_ptr<GameEngine> g_pEngine;
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,9 @@
 | 
			
		||||
#include "gamestate.hpp"
 | 
			
		||||
#include <memory>
 | 
			
		||||
 | 
			
		||||
int main(void)
 | 
			
		||||
{
 | 
			
		||||
    GameEngine game;
 | 
			
		||||
    game.Start();
 | 
			
		||||
    g_pEngine = std::make_unique<GameEngine>();
 | 
			
		||||
    g_pEngine->Start();
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user