I have just started Monogame development, though I have years of experience in XNA , and so far so good.
I have a couple of issues, the main one is that when you run in windowed mode on Windows 10, the window displayed is scaled by the desktop scale setting.
I use a 4K monitor for coding and have to scale the desktop by 1.75 to be able to read anything.
This scaling means I cannot drag the window to my second monitor for debugging because the post scaling resolution is greater than the resolution of the second monitor.
So ā¦
a) Is it possible to get a Monogame app to ignore the windows scaling?
b) Is it possible to force a Monogame app to start up on a particular monitor
Other than that it is going well. I ported my signed distance field font renderer to Monogame in about 10 minutes.
Ported my scene management system and scene transition system in another 10 minutes.
Is there a more final way to make that change? The only .manifest file I can find is in my gameās output folder where it compiles to. It also doesnāt have that section in it, but Iāll try adding it and see if it makes any difference next time Iām using my laptop (which has this same scaling problem).
You can include a .manifest file in your project root (thereās a template for it in VS) and set it as the .manifest file of your project in your project properties. Disabling dpi awareness can cause issues for MonoGame though. It may retrieve incorrect display resolutions from the GraohicsAdapter due to the scaling, which can cause a crash when creating a GraphicsDevice. This is why MG templates since 3.6 include a .manifest file making your project per monitor dpi aware (pm/true setting in the .manifest file).
When you create a fresh MonoGame 3.6 project by with one of the original templates, then the āapp.manifestā file is automatically a part of your project (root).
When you use an older version of MonoGame or upgraded from an older one, then you can easily add the manifest file by yourself.
Just add a new file to your project, call it āapp.manifestā and add the following to it:
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="Game1"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on and is
is designed to work with. Uncomment the appropriate elements and Windows will
automatically selected the most compatible environment. -->
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
</windowsSettings>
</application>
</assembly>
(This is what the original file contains)
After that you need to open the Properties of your project and select the new manifest file:
Edit: Please read the additional infomation provided by @Jjagg
Thanks for the explanation! I probably wonāt bother disabling it, then. Itās a tough problem though. I was noticing on my laptop that the resolutions that were retrieved from the GraphicsAdapter werenāt the computerās resolutions, but the scaled ones, and the game was zoomed in. Itās worth some tinkering later, probably.