/// <summary> /// Change display mode to windowed. /// </summary> void SetWindowed() { GraphicsManager.IsFullScreen = false; GraphicsManager.PreferredBackBufferWidth = windowedWidth; GraphicsManager.PreferredBackBufferHeight = windowedHeight; GraphicsManager.ApplyChanges(); currentWidth = Game.Window.ClientBounds.Width; currentHeight = Game.Window.ClientBounds.Height; ScaleView(); }
/// <summary> /// Change display mode to borderless fullscreen at native resolution. /// </summary> void SetFullscreen() { GraphicsManager.IsFullScreen = true; GraphicsManager.HardwareModeSwitch = false; //borderless window GraphicsManager.PreferredBackBufferWidth = nativeWidth; GraphicsManager.PreferredBackBufferHeight = nativeHeight; GraphicsManager.ApplyChanges(); currentWidth = Game.Window.ClientBounds.Width; currentHeight = Game.Window.ClientBounds.Height; ScaleView(); }
public void ToggleFullscreen() { GraphicsManager.ToggleFullScreen(); if (GraphicsManager.IsFullScreen) { GraphicsManager.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; GraphicsManager.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height; } else { GraphicsManager.PreferredBackBufferWidth = View.ResolutionWidth * 3; GraphicsManager.PreferredBackBufferHeight = View.ResolutionHeight * 3; } GraphicsManager.ApplyChanges(); }
protected override void Initialize() { // TODO: Add your initialization logic here this.RegisterGlobalComponent(new AudioManager(this.Game, @"Content\Audio\RpgAudio.xgs", @"Content\Audio\Wave Bank.xwb", @"Content\Audio\Sound Bank.xsb")); _SceneManager = new SceneManager(); _MainMenuState = new MainMenuState(); _PausedState = new PausedState(); _OptionsState = new OptionsState(); //#if DEBUG // AudioManager.Instance.MusicEnabled = false; //#endif // Start off in game. //_SceneManager.ChangeScene("BasicLevel", false); //StateManager.PushState(_SceneManager); StateManager.PushState(_MainMenuState); AudioManager.PlayMusic("Title1"); AudioManager.SetMusicVolume(0.5f); CreateNewPlayer(); GraphicsManager.ApplyChanges(); //#if DEBUG _SceneManager.AddComponent(new DebugComponent(_SceneManager)); //#endif }