locked
App orientation

    Question

  • Hi,

    I'm writing a C++/D3D app for Win Store 8 and am struggling with the orientation stuff.

    I've already got this going fine on Win Phone 8 by doing it all manually, eg: graphics/pointer coords are all rotated depending on DisplayProperties::CurrentOrientation, and swap chain is just left alone.

    But this doesn't seem to work on Win Store 8, the OS always seems to be trying to rotate my app for me.

    Is it possible then to get the OS to do *nothing* when device is rotated, and let me handle everything myself?

    Is this what Windows::Graphics::Display::DisplayProperties::AutoRotationPreferences is supposed to do? Unfortunately, I only have a simulator and this apparently only works on a real device so I'm unable to test if/how it works.

    If this is the way to go, what am I supposed to set it to anyway? DisplayOrientation::Landscape? Or None?

    Bye!
    Mark
    Friday, June 14, 2013 12:13 AM

Answers

  • Correct. AutoRotationPreferences is designed for this scenario. What you set it to depends on your app. If you want it to always run landscaped then use DisplayOrientation::Landscape .

    --Rob

    Friday, June 14, 2013 12:56 AM
    Moderator

All replies

  • Correct. AutoRotationPreferences is designed for this scenario. What you set it to depends on your app. If you want it to always run landscaped then use DisplayOrientation::Landscape .

    --Rob

    Friday, June 14, 2013 12:56 AM
    Moderator
  • Thanks, but AutoRotationPreferences doesn't work on the simulator so I can't use/test it.

    I managed to disable autorotation using method 2 on this page though: http://msdn.microsoft.com/en-us/library/windows/apps/jj262112.aspx - but there is a big nasty 'glitch' when rotation happens. First, there's the marching dots for several seconds, then a weird rotated version (OS generated?) pops up briefly before the correct version appears. I implemented the call to NotifyLayoutCompleted() inside CoreWindow::SizeChanged but it doesn't seem to make any difference. Is this another simulator difference?

    Friday, June 14, 2013 4:02 AM