Possible window resolution bug in MonoGame 3.8 DesktopGL?


I just discovered a bug related to the resolution of the game window.

If I set the resolution to (e.g. 640x480) using the PreferredBackBuffer (Width and Height), when I run the game, the change is not made (it still has the default MonoGame resolution (800x600)).

But if you switch to fullscreen mode, the indicated resolution (640x480) is applied and when you return to window mode, it is displayed with the defined resolution.

The strange thing is that internally the resolution before and after switching to fullscreen mode is always the same (in our example 640x480px). It should be noted that this bug happens with any resolution other than the default, either lower or higher than the default.

The version that I use of MonoGame is the DesktopGL

Link to program with the bug: https://github.com/davidgd72k/TryingResolution

If you have any questions about this, I will be happy to answer them.

You should write it in the Initialize() method, then it works fine.

Before setting the resolution try setting
graphics.HardwareModeSwitch = false;

Then change it back to true afterwards. See if that works

Hey, I try with said by boot and Pixi91, and it works.

Thanks! :grin: