/// <summary> /// Constructor. /// </summary> public Game() { this.Services = new GameServicesContainer(); this.gameWindow = new GameWindow(); this.SubscribeGameWindowEvents(); this.Services.AddService(typeof(IGameWindow), this.Window); this.gameClock = new GameClock(); this.gameTime = new GameTime(); }
/// <summary> /// Called when the game is being disposed. /// </summary> /// <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (disposing) { if (this.gameWindow != null) { this.UnsubscribeGameWindowEvents(); this.gameWindow.Dispose(); this.gameWindow = null; } } }