Add support for specifing monitor number for dx9 games

This commit is contained in:
Bemani Witch 2020-05-19 22:09:38 +02:00 committed by Bemani Witch
parent 82416115f5
commit 30e1d033c5
4 changed files with 7 additions and 1 deletions

View File

@ -30,6 +30,8 @@ subnet=192.168.100.0
windowed=1 windowed=1
; Add a frame to the game window if running windowed. ; Add a frame to the game window if running windowed.
framed=1 framed=1
; Select the monitor to run the game on. (Fullscreen only, 0 =primary screen)
monitor=0
; ----------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
; Input settings ; Input settings

View File

@ -15,4 +15,5 @@ void gfx_config_load(struct gfx_config *cfg, const wchar_t *filename)
cfg->enable = GetPrivateProfileIntW(L"gfx", L"enable", 1, filename); cfg->enable = GetPrivateProfileIntW(L"gfx", L"enable", 1, filename);
cfg->windowed = GetPrivateProfileIntW(L"gfx", L"windowed", 0, filename); cfg->windowed = GetPrivateProfileIntW(L"gfx", L"windowed", 0, filename);
cfg->framed = GetPrivateProfileIntW(L"gfx", L"framed", 1, filename); cfg->framed = GetPrivateProfileIntW(L"gfx", L"framed", 1, filename);
cfg->monitor = GetPrivateProfileIntW(L"gfx", L"monitor", 0, filename);
} }

View File

@ -147,7 +147,9 @@ static HRESULT STDMETHODCALLTYPE my_CreateDevice(
gfx_frame_window(hwnd); gfx_frame_window(hwnd);
} }
return IDirect3D9_CreateDevice(real, adapter, type, hwnd, flags, pp, pdev); dprintf("Gfx: IDirect3D9:: Using Display No %x\n", gfx_config.monitor);
return IDirect3D9_CreateDevice(real, gfx_config.monitor, type, hwnd, flags, pp, pdev);
} }
static HRESULT gfx_frame_window(HWND hwnd) static HRESULT gfx_frame_window(HWND hwnd)

View File

@ -6,6 +6,7 @@ struct gfx_config {
bool enable; bool enable;
bool windowed; bool windowed;
bool framed; bool framed;
int monitor;
}; };
void gfx_hook_init(const struct gfx_config *cfg); void gfx_hook_init(const struct gfx_config *cfg);