1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-05-29 03:23:37 +02:00

added a handler for this

This commit is contained in:
Ellpeck 2019-12-01 22:58:20 +01:00
parent 4325d51c95
commit d224d57cf2

View file

@ -1,3 +1,4 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@ -17,6 +18,9 @@ namespace MLEM.Extensions {
manager.PreferredBackBufferWidth = curr.Width;
manager.PreferredBackBufferHeight = curr.Height;
} else {
if (lastWidth <= 0 || lastHeight <= 0)
throw new InvalidOperationException("Can't call SetFullscreen to change out of fullscreen mode without going into fullscreen mode first");
manager.PreferredBackBufferWidth = lastWidth;
manager.PreferredBackBufferHeight = lastHeight;
}