Search code examples
c#windowsmonogame

Bug when returning to windows desktop MonoGame


I have created a monogame project for Windows but when I return on the windows desktop with alt + tab the game screen turns white and the icon disappears.

I only changed the screen size to 1920 x 1080, fullscreen = true and Windows.title = "The Last Dragon"

public Game1()
{
    graphics = new GraphicsDeviceManager(this);
    Content.RootDirectory = "Content";
    graphics.PreferredBackBufferWidth = 1920;
    graphics.PreferredBackBufferHeight = 1080;
    graphics.IsFullScreen = true;
}
protected override void Initialize()
{
     // TODO: Add your initialization logic here
    this.Window.Title = "The Last Dragon";

    base.Initialize();
}

Solution

  • When changing Settings of the GraphicsDeviceManager always make sure to apply those changes. in your case graphics.ApplyChanges();