View Single Post
Old 29 April 2018, 19:41   #1
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,343
Optimised support for non-landscape monitor orientations

Does WinUAE have any support for non-landscape orientation displays? If not, the DWM/runtime will have to rotate the image for composition/presentation. Could it be more optimal to generate a pre-rotated image yourself, by changing the D3D projection matrix to be rotated 90 degrees?

For example, suppose the monitor is in portrait orientation: the screen has been rotated 90 degress clockwise from horizontal. Then the desktop image is effectively rotated 90 degrees anti-clockwise so as to appear the right way up. What was the top edge of the monitor is now the right edge, so the video signal scans the image top-to-bottom, from rightmost column to the leftmost.

For D3D11, there is IDXGISwapChain1::SetRotation. You'd specify DXGI_MODE_ROTATION_IDENTITY to tell Windows not to rotate the image. [That only applies to flip-model windowed swap chains.]

There's also DXGI_SWAP_CHAIN_FLAG_NONPREROTATED: "Set this flag to turn off automatic image rotation; that is, do not perform a rotation when transferring the contents of the front buffer to the monitor. Use this flag to avoid a bandwidth penalty when an application expects to handle rotation. This option is valid only during full-screen mode"

And see DXGI swap chain rotation sample. Also Supporting screen orientation (DirectX and C++), but that's probably UWP-specific.

I guess it's also possible to detect a change in orientation while running (WM_DISPLAYCHANGE???). WinUAE currently doesn't handle that too well. For example:
- Run WinUAE, settings window appears.
- Use Windows display settings to change orientation to portrait.
- Start emulation with D3D11 full-screen mode. Display is distorted; wrong orientation and squashed.

Last edited by mark_k; 29 April 2018 at 19:49.
mark_k is offline  
 
Page generated in 0.06399 seconds with 11 queries