Hehe, you seem to be taking me for someone “in the know” I’m just a guy with too much time on his hands. I’m far from an expert on rendering (though I did write a hello world triangle in OpenGL once).
One thing I forgot to mention, there’s an r.GraphicsAdapter console/.ini cvar which has the same effect as setting the adapter index with a plugin. However the HMD adapter takes precedence if there is one. Also, as far as I know there is no way to specify cvars on the command line (there are lots of command line options including the ability to override ini filenames, but not the settings themselves). Definitely a major shortcoming of UE IMO.
As to why UE4 isn’t using Present1? Your guess is as good as mine. I thought it might be for backwards compatibility with older Windows versions, but the D3D12 RHI also uses Present.
GetGraphicsAdapter() does indeed get the adapter, not set it, hence the name But you can obviously make your plugin inherit from IHeadMountedDisplayModule and provide whatever value you want. The final D3D11CreateDevice call still gets done by the RHI though.
Nope. Hope someone proves me wrong. There is -ResX and -ResY, which I often use to put the log console on my second monitor (-ResX=1920). But it doesn’t seem to work for the game/editor.
As for your bug, I can’t really help you with that. There’s FDisplayMetrics which works perfectly to get the fullscreen resolutions of all connected monitors, but it wouldn’t work to get the size of the game area if it’s in windowed mode. The best I can come up with is to register a CVar sink with IConsoleManager for the r.setres variable. That way you’ll be notified when the window resolution changes.