- #WINDOWS MONITOR ORIENTATION SOFTWARE#
- #WINDOWS MONITOR ORIENTATION CODE#
- #WINDOWS MONITOR ORIENTATION WINDOWS#
To perform a basic display resize and pre-rotate its contents in your UWP DirectX app, implement these steps: Resizing the swap chain and pre-rotating its contents
#WINDOWS MONITOR ORIENTATION CODE#
Change the rendering code to generate images aligned with the user orientation of the device.Notify Windows 10 of the orientation of the swap chain using IDXGISwapChain1::SetRotation.Use a combination of the window bounds values and the display orientation data to keep the swap chain aligned with the native display orientation of the device.Overall, this is the general process for handling changes in screen orientation: Time is allocated by Windows 10 to the app for layout in the new orientation. As the display orientation shifts, the user sees these shifts as a fixed zoom and rotation animation of the displayed screen image. When the display rotates from one orientation to another, Windows 10 internally performs a rotation operation to align the drawn image with the new orientation, and the user sees an upright image on the screen.Īlso, Windows 10 displays automatic transition animations to create a smooth user experience when shifting from one orientation to another. Portrait, flipped-the display has been rotated clockwise 270 degrees (or counter-clockwise 90 degrees).Landscape, flipped-the display has been rotated 180 degrees (turned upside-down).Portrait-the display has been rotated clockwise 90 degrees (or counter-clockwise 270 degrees).
#WINDOWS MONITOR ORIENTATION SOFTWARE#
Windows 10 devices can determine their current display orientation (with some sort of sensor, or with a software toggle) and allow users to change the display settings. Here, we'll discuss best practices for handling screen rotation in your UWP DirectX app, so that the Windows 10 device's graphics hardware are used efficiently and effectively.īefore you start, remember that graphics hardware always outputs pixel data in the same way, regardless of the orientation of the device.
#WINDOWS MONITOR ORIENTATION WINDOWS#
Your Universal Windows Platform (UWP) app can support multiple screen orientations when you handle the DisplayInformation::OrientationChanged event.