[Fixed] Can't change resolution in cross-platform desktop project - version 3.8.0.1641

I just went through the process of creating a new cross-platform desktop project and transferring my current project files over to it. For some reason, the window is stuck at the initial 800 by 480 resolution. PreferredBackBufferWidth/Height does nothing, and directly setting GraphicsDevice.PresentationParameters.BackBufferWidth/Height, even in the update loop, does nothing either.

To check, I created a blank new cross-platform project and confirmed that, even in a blank project, PreferredBackBufferWidth/Height is ignored.

Edit: Actually, I’m not even sure what version of Monogame the project is using. Presumably just the version that the template extension grabbed from Nuget when I created the project, if that’s how it works.

Hi @HopefulFrog Welcome to the Community!

What setup are you using and what IDE, someone can help better knowing this for the other question.

For the main question, are you applying changes?

Happy Coding!

I’m on Visual Studio 2019, Windows 10. I thought you didn’t have to call ApplyChanges in the constructor for Game1.

I tried it, and ApplyChanges works to change the resolution if I call it after setting the PreferredBackBufferWidth and Height in Update or Draw, but not in the constructor nor the initialization methods. If I set the Width and Height in the constructor and call ApplyChanges anywhere, it has no effect.

The inline documentation for PreferredBackBufferWidth and Height says that setting them during startup should automatically set the resolution without calling ApplyChanges, though in this case, it seems the resolution cannot be changed during initialization at all. I’ll submit an issue to the Github page.

1 Like

I found that I could not change resolution in the Game1 constructor but I could in the Initialize method. You do need to call ApplyChanges.

1 Like

OK, and which project templates are you building from?

If using NUGET open the NUGET Manager and find the installed package to find the used version:

Hope this helps…

Yeah, that does work. That’s good. I’m just used to setting the resolution in the constructor from my time working with DirectX projects.

It’s listed as 3.8.0.1641, so I guess the title of the thread is right! Is this expected behavior for OpenGL projects? If so, I can close the issue on Github, but it seems weird that it works in DirectX but not OpenGL.

Apparently it’s been fixed, but the change has yet to make it to the stable release.

Cool, at least you got this sorted now :sake:

EDIT

I’m really not the one to ask concerning OpenGL