1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

make nonexclusive= .ini settings work with direct3d 9 too

This commit is contained in:
FunkyFr3sh 2020-10-21 16:21:15 +02:00
parent 8e54756b4a
commit c834411677
2 changed files with 10 additions and 1 deletions

View File

@ -312,7 +312,7 @@ static void cfg_create_ini()
"; Note: Set this to a low value such as 5 or 10 if some parts of the game are not being displayed (e.g. menus or loading screens)\n"
"minfps=0\n"
"\n"
"; Disable fullscreen-exclusive mode for the OpenGL renderer\n"
"; Disable fullscreen-exclusive mode for the direct3d9/opengl renderers\n"
"; Note: Can be used in case some GUI elements like buttons/textboxes/videos/etc.. are invisible\n"
"nonexclusive=false\n"
"\n"

View File

@ -43,6 +43,15 @@ BOOL d3d9_create()
if (g_d3d9.hmodule)
{
if (g_ddraw->nonexclusive)
{
int (WINAPI* d3d9_enable_shim)(BOOL) =
(int (WINAPI*)(BOOL))GetProcAddress(g_d3d9.hmodule, "Direct3D9EnableMaximizedWindowedModeShim");
if (d3d9_enable_shim)
d3d9_enable_shim(TRUE);
}
IDirect3D9 *(WINAPI *d3d_create9)(UINT) =
(IDirect3D9 *(WINAPI *)(UINT))GetProcAddress(g_d3d9.hmodule, "Direct3DCreate9");