void Reset() { MediaPlayer.Stop(); screenManager.Dispose(); LoadConfig(); int width = (int.TryParse(ConfigurationManager.AppSettings["ScreenWidth"], out width) ? width : GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width); int height = (int.TryParse(ConfigurationManager.AppSettings["ScreenHeight"], out height) ? height : GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height); screenSize = new Vector2(width, height); graphics.PreferredBackBufferWidth = (int)screenSize.X; graphics.PreferredBackBufferHeight = (int)screenSize.Y; graphics.SynchronizeWithVerticalRetrace = false; graphics.ApplyChanges(); particleSystem = new ParticleSystem(); currentPlatform = 0; currentThumbnail = 0; screenManager = new GameScreenManager(spriteBatch, Content); screenManager.OnGameExit += Exit; screenManager.ChangeScreen(new MainScreen(screenManager, GraphicsDevice)); }
protected override void UnloadContent() { // TODO: Unload any non ContentManager content here if (m_screenManager != null) { m_screenManager.Dispose(); } }
/// <summary> /// UnloadContent will be called once per game and is the place to unload /// game-specific content. /// </summary> protected override void UnloadContent() { if (gameScreenManager != null) { gameScreenManager.Dispose(); gameScreenManager = null; } }
/// <summary> /// UnloadContent will be called once per game and is the place to unload /// game-specific content. /// </summary> protected override void UnloadContent() { if (m_screenManager != null) { m_screenManager.Dispose(); m_screenManager = null; } }