locked
Windows Simulator 10.6" 1920x1080 snapped view wrong size?

    Question

  • Based on various posts here and MSDN, I've written code in my game to detect snapped view by looking for a back buffer width of 320 pixels. When I see this, I pause my game and show an appropriate message. HOWEVER, while testing snapped view at various resolutions and orientations in the simulator, I noticed that in 10.6" 1920x1080 snapped view reports the back buffer as 447, not 320! All of the other supported resolutions correctly set the snapped size to 320, even the 23" edition of 1920x1080.

    Is this a known in the simulator or did I miss something?

    Thanks,

    -Rob Targosz

    www.eragion.com

    Thursday, December 27, 2012 3:34 AM

Answers

  • The snapped area of course is not always 320px wide - just think of a high-res display with 320dpi, having a snapped area width of only 1 inch.

    Windows will scale the area automatically, just like Windows scales images and Font sizes. Since this is done automatically, you don't really need to care. At least when you work with XAML. No idea if you need to care when using DirectX.

    Sunday, December 30, 2012 11:14 AM

All replies

  • The snapped area of course is not always 320px wide - just think of a high-res display with 320dpi, having a snapped area width of only 1 inch.

    Windows will scale the area automatically, just like Windows scales images and Font sizes. Since this is done automatically, you don't really need to care. At least when you work with XAML. No idea if you need to care when using DirectX.

    Sunday, December 30, 2012 11:14 AM
  • Of course? Hmmm...according to Microsoft, snapped mode is supposed to ALWAYS BE EXACTLY 320px wide, regardless of resolution:

    http://msdn.microsoft.com/en-us/library/windows/apps/hh465371.aspx

    There's also a blog that hard-codes this 320px value for testing:

    http://blogs.msdn.com/b/davedev/archive/2012/05/22/handling-fullscreen-snapped-and-filled-states-in-windows-8-metro-style-apps-using-css3-and-javascript.aspx

    The Hyper-V simulator itself shows exactly 320px wide in 10.6" 1366x768 and 27" 2560x1440, but not for 10.6" 1920x1080.

    Finally, I have a dozen or so different test systems running Win8 with resolutions from 1366x768 through to 2560x1440 and all of them show exactly 320px.

    For many games, it's not ideal to allow the user to play inside the snapped view due to the resolution change (320x1440 is awkward!), so they often show a pause page or something.

    Frankly, this looks like a BUG in the simulator to me!

    Thursday, January 03, 2013 2:05 AM
  • The Hyper-V simulator itself shows exactly 320px wide in 10.6" 1366x768 and 27" 2560x1440, but not for 10.6" 1920x1080.

    Finally, I have a dozen or so different test systems running Win8 with resolutions from 1366x768 through to 2560x1440 and all of them show exactly 320px.

    Yes, the docs are definitely wrong. Or at least not complete. As far as I can tell, the physical width of the snapped area depends on the dpi of the physical screen: similar to the auto-scaling of images, fonts and XAML control sizes, the snapped area is auto-scaled. I didn't do the math, but I suspect the snapped area has sizes of 320px, 320px*140% and 320px*180%.

    There's also a blog that hard-codes this 320px value for testing:

    XAML/HTML: The auto-scaling is done by the OS, so you really don't need to care (other than providing images for multiple scale factors). This could also be the reason why the hardcoded 320px works.

    DirectX: No idea. But if your code reports a width of 448px, then IMHO you better believe your code instead of the documentation ;-)

    Thursday, January 03, 2013 8:39 AM