I have a game that supports touchscreen, keyboard, and mouse. It includes a MonoGame Windows 10 UWP project and a MonoGame Windows Project.
When the game is played in tablet mode, I want to lock the screen orientation in Landscape or Landscape-flipped.
On the UWP build I can accomplish this by setting the Package.appxmanifest property Supported Rotation. Everything works fine.
On the Windows build, there is no Package.appxmanifest. I tried setting the property GraphicsDeviceManager.SupportedOrientations in the base game class's constructor as seen below. However, this does not prevent the game from switching between portrait and landscape mode when in tablet mode.
graphics = new GraphicsDeviceManager(this)
SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight
My goal is to keep a build of the game that does not require UWP/Windows Store. For this build, if the computer happens to be a 2 in 1, I want to user to be able to play the game in tablet mode if they desire. However, the game mechanics and graphics lend very poorly to portrait mode.
So, what is the proper way to handle switching screen orientation when using the MonoGame Windows Project? Or is this just not possible with the framework?
Using MonoGame 126.96.36.1994 with VS2017
Behaviour observed on a Windows 10 x64 machine.