0

Windows Phone 8.1 DirectX Sample Landscape mode broken / rotation doesn’t work.

PortraitThe Problem: When the phone is in landscape mode, the rendered area isn’t rotated on screen! As you can see, the image on the right is when it is in portrait mode, the one below is when in landscape.

The problem is caused by the following code in DeviceResources.cpp:

	DX::ThrowIfFailed(
		m_swapChain->SetRotation(displayRotation)
		);

Since the window size being created is always the right size because in Windows Phone 8.1 the Bounds of the CoreWindow are reported correctly, we don’t actually need to rotate the swap buffer at all!

Either remove the code above or simple change it to:

	DX::ThrowIfFailed(
		m_swapChain->SetRotation(DXGI_MODE_ROTATION_IDENTITY)
		);

And it’s fixed! I hope this has helped đŸ™‚

Landscape