mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-05 11:44:53 +01:00
Refactor dx device creation
Find the game's window instead of using the foreground window.
This commit is contained in:
parent
dc7480c633
commit
5a0653d080
7 changed files with 71 additions and 12 deletions
|
|
@ -17,6 +17,10 @@ bool DX10_Hook::start_hook()
|
|||
if (!Windows_Hook::Inst().start_hook())
|
||||
return false;
|
||||
|
||||
HWND hWnd = GetGameWindow();
|
||||
if (!hWnd)
|
||||
return false;
|
||||
|
||||
IDXGISwapChain* pSwapChain;
|
||||
ID3D10Device* pDevice;
|
||||
DXGI_SWAP_CHAIN_DESC SwapChainDesc = {};
|
||||
|
|
@ -29,7 +33,7 @@ bool DX10_Hook::start_hook()
|
|||
SwapChainDesc.BufferDesc.RefreshRate.Numerator = 0;
|
||||
SwapChainDesc.BufferDesc.RefreshRate.Denominator = 0;
|
||||
SwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
|
||||
SwapChainDesc.OutputWindow = GetForegroundWindow();
|
||||
SwapChainDesc.OutputWindow = hWnd;
|
||||
SwapChainDesc.SampleDesc.Count = 1;
|
||||
SwapChainDesc.SampleDesc.Quality = 0;
|
||||
SwapChainDesc.Windowed = TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue