Aleksoid1978 / VideoRenderer

Внешний видео-рендерер
GNU General Public License v3.0
1.03k stars 115 forks source link

DX11 and put_Owner not working? #50

Closed adipose closed 2 years ago

adipose commented 2 years ago

I'm not sure what the cause is, here, but I can confirm in D3D9, rendering to a window assigned with put_Owner() works. But upon switching to D3D11, it does not.

See thread here:

https://github.com/clsid2/mpc-hc/pull/1614

Any chance this could be a bug in MPCVR?

clsid2 commented 2 years ago

To test it, get 1.9.20.21 Options > advanced > FullscreenSeparateControls

Aleksoid1978 commented 2 years ago

Everything works, but there is one thing - I create my own window with the parent that was passed to put_Owner(), for D3D9/D3D11 modes.

clsid2 commented 2 years ago

I forgot to mention that you need to configure the fullscreen monitor: Options > Playback > Fullscreen

Then open player on monitor 1 and set monitor 2 for fullscreen. With this new option the player window and controls stay on monitor 1 and separate fullscreen window gets created on monitor 2.

Aleksoid1978 commented 2 years ago

I think I understood what could be the matter - initialization compares DXGIAdapter, and even if different screens but the same video card, then it will be the same DXGIAdapter and reinitialization will not happen.

clsid2 commented 2 years ago

It is difficult to understand the code if written by someone else. Your Init() does something different with the hwnd pointers based on whether DX9 VP is used or not. I tried changing that to make DX11 do same as DX9, but still not working. Can you tell why DX11 is handled differently there?

Why create child window instead of using parent directly?

Edit: Maybe if owner is changed, set a boolean to force reinitialization. That could maybe solve the problem.

adipose commented 2 years ago

Having a window inside the window should theoretically work, I guess. But it doesn't explain the problem with DX11.

Aleksoid1978 commented 2 years ago

Try this patch: D3D11.diff.zip Test build: MpcVideoRenderer-0.5.7.1831_git2022.03.23-43996b7.zip

clsid2 commented 2 years ago

That works!