CurrentDisplayMode is sometimes null when starting

OK, I can repro the crash on my laptop monitor.

First I had to select the manifest file under Properties.
I can also verify that it does not crash when the manifest file is included and defines the dpiAware property to true.

Also, the workaround to the crash is for the user to check the box “Deactivate scaling” on the program properties Compatibility tab.

Next I will try scaling the game.

Although I don’t see it being mentioned, I will just add this, Scaling can be enabled by default, this happens on My Surface devices and even My other Windows 8/10 tablets by default and both when new after purchase and after a refresh of the OS.

I am surprised this has not been addressed yet… or brought up more often or has it? [ I mean has it been mentioned before ]

So probably a good thing for this to be done for any project targeting said OSs, and this is a pinned thread for me for sure until it is incorporated to the templates or something.

Thanks @Jjagg and @monogany <-- That name :grinning:

Valentine

[EDIT Woops… typo]

Scaling seems to work - kind of.
I tried taking a screenshot of the game window and measuring it in paint.net.
I used a game resolution of 1620 * 900.
100% gives 1592 * 884
125%: same.
150% gives 1905 * 1068

I might be too new to understand this but why that resolution?

I also have extra tools and windows that I look at while debugging so I need some extra space around the game window. So it makes it easier to debug on my monitor (1920 * 1200).

Have you tried perhaps, a second monitor?

I would suggest using 1280x720 as this would scale well in 16:9 resolutions

See Below [Found it on a web search with phrase: Resolution Scaling Graphs]

Hope that helps…

Valentine