Nintendo Switch - Docking/Undocking Resolution Changes

(New to the forums, let me know if I should be posting Nintendo Switch questions in another category. I did not see any dedicated to the Switch.))

Just curious how MonoGame/Switch handles running 720p on LCD/OLED screen and then being docked to a 1080p TV? What’s that process like? How should it be handled in the game code? Should we stick to 720p or should we change to 1080p? Can MonoGame accomplish that?

(Lots of questions. Looking to connect with Switch developers!)

1 Like

Nintendo Switch development is generally NDA’d, so it’s hard to give an exact answer.

However, FNA — another MonoGame-like reimplementation of the XNA libraries, which also supports Switch — has the following to say. Check the “Window Size Changes” section. A similar sort of approach would in theory be needed on MonoGame as well. Probably the same exact code could be used, since FNA and MonoGame are nearly API-compatible. (In general, being able to deal with window size changes robustly is useful for games on other platforms as well.)

Thanks, mcmillen.

I was under the impression – from developer hearsay – that MonoGame could not change resolutions on the fly on any platform. If so, a PC game with screen resolution options would require finessing a reboot of the game. This was part of my inspiration to see how it is handled on a the Switch, a platform that may force resolution changes (or scales whatever resolution you choose, such as Zelda’s 900p).
I was also not aware that FNA supports the Switch.

(Cool game you are working on, by the way.)

Hm, it seems false that MonoGame can’t change resolutions on the fly. I don’t know about all platforms, but I can do the following (as a test) and it does what you’d expect on PC. Seems to work regardless of whether I’m in fullscreen mode or windowed.

int graphicsWidth = 1280;
int graphicsHeight = 720;
double timeSinceLastGraphicsChange = 0;

// Updates the game world.
protected override void Update(GameTime gameTime) {
  timeSinceLastGraphicsChange += gameTime.ElapsedGameTime.TotalSeconds;
  if (timeSinceLastGraphicsChange > 5) {
    timeSinceLastGraphicsChange = 0;
    graphicsWidth += 10;
    graphicsHeight += 10;
    graphics.PreferredBackBufferWidth = graphicsWidth;
    graphics.PreferredBackBufferHeight = graphicsHeight;

  // rest of Update() goes here

mcmillen, thanks for the clarification and the code! Helps so much to break that myth. We will be making use of your code shortly to test it out on our end!