/// <summary> /// Run the specified game. /// </summary> /// <param name="game">Game to run.</param> public virtual void Run(Game game) { GameTree.SetRunningGame(game); // - Initialize windows manager Windows.Initialize(); // - Make a new window Window.Make(); Window.Show(); // - Initialize input apis Input.Initialize(); // - Add services GameTree.AddService(Input.GetSettings(PhysicsGameLoop)); GameTree.AddService(Windows.GetSettings(PhysicsGameLoop)); // - Load the game GameTree.Initialize(); // - Start gameloops PhysicsGameLoop.Run(); InputGameLoop.Run(); }
/// <summary> /// Close the running game. /// </summary> public virtual void Close() { if (!GameTree.CloseGame()) { return; } PhysicsGameLoop.Stop(); InputGameLoop.Stop(); }