gitadora: add native dual fullscreen for Arena (#846)
## Link to GitHub Issue or related Pull Request, if one exists Fixed https://github.com/spice2x/spice2x.github.io/issues/740 ## Description of change - Enable native D3D9 adapter-group dual fullscreen for the GITADORA Arena model when the two-screen MAIN + SMALL configuration is selected without windowed mode. - Present MAIN and SMALL on their respective monitor heads while keeping the invisible LEFT and RIGHT targets offscreen. - Scope the new fake-swap-chain query behavior to the hidden GITADORA two-head targets, preserving existing behavior for other games and configurations. The existing borderless-windowed two-screen path could not consistently keep input and game timing synchronized and also reduced rendering performance. Native dual fullscreen avoids that windowed composition path. ## Testing - Manually tested GITADORA Arena with separate MAIN and SMALL monitors in fullscreen mode. Windowed mode still works if the user chooses to use that. - Confirmed both displays render correctly, touch input works on the SMALL screen, gameplay input stays synchronized, and gameplay holds a steady 60 FPS. - Built `spicetools_spice64` at commit `e4a98e9` with the repository Docker toolchain. - Confirmed no new compiler warnings. - Confirmed the forbidden static DLL import check passes. - Confirmed the Windows 7 DLL compatibility check reports `All DLLs OK!`. --------- Co-authored-by: vgod <428979+vgod@users.noreply.github.com>
This commit is contained in:
co-authored by
vgod
parent
c590b87cff
commit
3012139028
@@ -41,7 +41,6 @@
|
||||
constexpr bool CUSTOM_RESET = false;
|
||||
|
||||
constexpr D3DFORMAT D3DFMT_DF24 = static_cast<D3DFORMAT>(MAKEFOURCC('D', 'F', '2', '4'));
|
||||
|
||||
auto format_as(D3DPOOL f) {
|
||||
return fmt::underlying(f);
|
||||
}
|
||||
@@ -85,7 +84,8 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::QueryInterface(
|
||||
return E_POINTER;
|
||||
}
|
||||
|
||||
if (riid == IID_WrappedIDirect3DDevice9 ||
|
||||
if ((riid == IID_IUnknown && is_gfdm_two_head_exclusive()) ||
|
||||
riid == IID_WrappedIDirect3DDevice9 ||
|
||||
riid == IID_IDirect3DDevice9 ||
|
||||
riid == IID_IDirect3DDevice9Ex)
|
||||
{
|
||||
@@ -202,6 +202,15 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetDirect3D(
|
||||
IDirect3D9 **ppD3D9)
|
||||
{
|
||||
WRAP_VERBOSE;
|
||||
if (is_gfdm_two_head_exclusive() && gfdm_parent_d3d != nullptr) {
|
||||
if (ppD3D9 == nullptr) {
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
gfdm_parent_d3d->AddRef();
|
||||
*ppD3D9 = gfdm_parent_d3d;
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
CHECK_RESULT(pReal->GetDirect3D(ppD3D9));
|
||||
}
|
||||
|
||||
@@ -209,7 +218,13 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetDeviceCaps(
|
||||
D3DCAPS9 *pCaps)
|
||||
{
|
||||
WRAP_VERBOSE;
|
||||
CHECK_RESULT(pReal->GetDeviceCaps(pCaps));
|
||||
HRESULT result = pReal->GetDeviceCaps(pCaps);
|
||||
if (SUCCEEDED(result) && is_gfdm_two_head_exclusive() && pCaps != nullptr) {
|
||||
pCaps->NumberOfAdaptersInGroup = GFDM_LOGICAL_HEAD_COUNT;
|
||||
pCaps->MasterAdapterOrdinal = 0;
|
||||
pCaps->AdapterOrdinalInGroup = 0;
|
||||
}
|
||||
CHECK_RESULT(result);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetDisplayMode(
|
||||
@@ -217,6 +232,17 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetDisplayMode(
|
||||
D3DDISPLAYMODE *pMode)
|
||||
{
|
||||
WRAP_VERBOSE;
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_side_swapchain(iSwapChain))
|
||||
{
|
||||
return ensure_gfdm_hidden_side_swapchain(iSwapChain)->GetDisplayMode(pMode);
|
||||
}
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_small_swapchain(iSwapChain))
|
||||
{
|
||||
CHECK_RESULT(pReal->GetDisplayMode(GFDM_NATIVE_SMALL_SWAPCHAIN, pMode));
|
||||
}
|
||||
|
||||
CHECK_RESULT(pReal->GetDisplayMode(iSwapChain, pMode));
|
||||
}
|
||||
|
||||
@@ -258,6 +284,51 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::CreateAdditionalSwapChain(
|
||||
{
|
||||
WRAP_VERBOSE;
|
||||
|
||||
if (pPresentationParameters == nullptr || ppSwapChain == nullptr) {
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (is_gfdm_two_head_exclusive()) {
|
||||
if (pPresentationParameters->BackBufferWidth == 800) {
|
||||
return GetSwapChain(gfdm_logical_small_swapchain, ppSwapChain);
|
||||
}
|
||||
if (pPresentationParameters->BackBufferWidth != 1080) {
|
||||
log_warning(
|
||||
"graphics::d3d9",
|
||||
"two-head exclusive: rejecting unexpected additional swap chain {}x{}",
|
||||
pPresentationParameters->BackBufferWidth,
|
||||
pPresentationParameters->BackBufferHeight);
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
size_t index = 3;
|
||||
for (UINT logical_swapchain = 1;
|
||||
logical_swapchain < GFDM_LOGICAL_HEAD_COUNT;
|
||||
logical_swapchain++)
|
||||
{
|
||||
if (!is_gfdm_logical_side_swapchain(logical_swapchain)) {
|
||||
continue;
|
||||
}
|
||||
const size_t candidate =
|
||||
gfdm_hidden_side_swapchain_slot(logical_swapchain);
|
||||
if (fake_sub_swapchain[candidate] == nullptr) {
|
||||
index = candidate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index == 3) {
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
fake_sub_swapchain[index] = new FakeIDirect3DSwapChain9(
|
||||
this,
|
||||
pPresentationParameters,
|
||||
is_d3d9ex,
|
||||
true);
|
||||
fake_sub_swapchain[index]->AddRef();
|
||||
*ppSwapChain = static_cast<IDirect3DSwapChain9 *>(fake_sub_swapchain[index]);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
bool create_swap_chain = false;
|
||||
bool create_fake_swap_chain = false;
|
||||
@@ -271,6 +342,7 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::CreateAdditionalSwapChain(
|
||||
// SMALL (subscreen)
|
||||
create_swap_chain = true;
|
||||
index = 0;
|
||||
|
||||
} else if (pPresentationParameters->BackBufferWidth == 1080) {
|
||||
// LEFT/RIGHT
|
||||
create_swap_chain = true;
|
||||
@@ -335,6 +407,10 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetSwapChain(
|
||||
{
|
||||
WRAP_VERBOSE_FMT("GetSwapChain({})", iSwapChain);
|
||||
|
||||
if (ppSwapChain == nullptr) {
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (iSwapChain == 0) {
|
||||
if (!main_swapchain) {
|
||||
HRESULT ret = pReal->GetSwapChain(iSwapChain, ppSwapChain);
|
||||
@@ -344,7 +420,12 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetSwapChain(
|
||||
return ret;
|
||||
}
|
||||
|
||||
main_swapchain = new WrappedIDirect3DSwapChain9(this, *ppSwapChain);
|
||||
main_swapchain = new WrappedIDirect3DSwapChain9(
|
||||
this,
|
||||
*ppSwapChain,
|
||||
is_gfdm_two_head_exclusive()
|
||||
? WrappedIDirect3DSwapChain9::NativeGroupHead::Main
|
||||
: WrappedIDirect3DSwapChain9::NativeGroupHead::Unknown);
|
||||
}
|
||||
|
||||
main_swapchain->AddRef();
|
||||
@@ -354,6 +435,39 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetSwapChain(
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
if (is_gfdm_two_head_exclusive()) {
|
||||
if (is_gfdm_logical_small_swapchain(iSwapChain)) {
|
||||
if (!sub_swapchain[0]) {
|
||||
IDirect3DSwapChain9 *real_swapchain = nullptr;
|
||||
HRESULT ret = pReal->GetSwapChain(
|
||||
GFDM_NATIVE_SMALL_SWAPCHAIN,
|
||||
&real_swapchain);
|
||||
if (FAILED(ret)) {
|
||||
return ret;
|
||||
}
|
||||
sub_swapchain[0] = new WrappedIDirect3DSwapChain9(
|
||||
this,
|
||||
real_swapchain,
|
||||
WrappedIDirect3DSwapChain9::NativeGroupHead::Small);
|
||||
sub_swapchain[0]->should_run_hooks = false;
|
||||
}
|
||||
|
||||
sub_swapchain[0]->AddRef();
|
||||
*ppSwapChain = static_cast<IDirect3DSwapChain9 *>(sub_swapchain[0]);
|
||||
graphics_screens_register(iSwapChain);
|
||||
return D3D_OK;
|
||||
}
|
||||
if (is_gfdm_logical_side_swapchain(iSwapChain)) {
|
||||
FakeIDirect3DSwapChain9 *swapchain =
|
||||
ensure_gfdm_hidden_side_swapchain(iSwapChain);
|
||||
swapchain->AddRef();
|
||||
*ppSwapChain = static_cast<IDirect3DSwapChain9 *>(swapchain);
|
||||
graphics_screens_register(iSwapChain);
|
||||
return D3D_OK;
|
||||
}
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
bool swap = false;
|
||||
if (iSwapChain == 1 && avs::game::is_model({"LDJ", "KFC", "M39"})) {
|
||||
swap = true;
|
||||
@@ -390,6 +504,10 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetSwapChain(
|
||||
UINT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetNumberOfSwapChains() {
|
||||
WRAP_VERBOSE;
|
||||
|
||||
if (is_gfdm_two_head_exclusive()) {
|
||||
return GFDM_LOGICAL_HEAD_COUNT;
|
||||
}
|
||||
|
||||
UINT n = pReal->GetNumberOfSwapChains();
|
||||
|
||||
if (sub_swapchain[0] && avs::game::is_model({"LDJ", "KFC", "M39"})) {
|
||||
@@ -453,6 +571,24 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetBackBuffer(
|
||||
IDirect3DSurface9 **ppBackBuffer)
|
||||
{
|
||||
WRAP_VERBOSE;
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_side_swapchain(iSwapChain))
|
||||
{
|
||||
return ensure_gfdm_hidden_side_swapchain(iSwapChain)->GetBackBuffer(
|
||||
iBackBuffer,
|
||||
Type,
|
||||
ppBackBuffer);
|
||||
}
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_small_swapchain(iSwapChain))
|
||||
{
|
||||
CHECK_RESULT(pReal->GetBackBuffer(
|
||||
GFDM_NATIVE_SMALL_SWAPCHAIN,
|
||||
iBackBuffer,
|
||||
Type,
|
||||
ppBackBuffer));
|
||||
}
|
||||
|
||||
CHECK_RESULT(pReal->GetBackBuffer(iSwapChain, iBackBuffer, Type, ppBackBuffer));
|
||||
}
|
||||
|
||||
@@ -461,6 +597,20 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetRasterStatus(
|
||||
D3DRASTER_STATUS *pRasterStatus)
|
||||
{
|
||||
WRAP_DEBUG;
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_side_swapchain(iSwapChain))
|
||||
{
|
||||
return ensure_gfdm_hidden_side_swapchain(iSwapChain)->GetRasterStatus(
|
||||
pRasterStatus);
|
||||
}
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_small_swapchain(iSwapChain))
|
||||
{
|
||||
CHECK_RESULT(pReal->GetRasterStatus(
|
||||
GFDM_NATIVE_SMALL_SWAPCHAIN,
|
||||
pRasterStatus));
|
||||
}
|
||||
|
||||
CHECK_RESULT(pReal->GetRasterStatus(iSwapChain, pRasterStatus));
|
||||
}
|
||||
|
||||
@@ -477,6 +627,18 @@ void STDMETHODCALLTYPE WrappedIDirect3DDevice9::SetGammaRamp(
|
||||
const D3DGAMMARAMP *pRamp)
|
||||
{
|
||||
WRAP_DEBUG;
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_side_swapchain(iSwapChain))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_small_swapchain(iSwapChain))
|
||||
{
|
||||
pReal->SetGammaRamp(GFDM_NATIVE_SMALL_SWAPCHAIN, Flags, pRamp);
|
||||
return;
|
||||
}
|
||||
|
||||
pReal->SetGammaRamp(iSwapChain, Flags, pRamp);
|
||||
}
|
||||
|
||||
@@ -485,6 +647,21 @@ void STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetGammaRamp(
|
||||
D3DGAMMARAMP *pRamp)
|
||||
{
|
||||
WRAP_DEBUG;
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_side_swapchain(iSwapChain))
|
||||
{
|
||||
if (pRamp != nullptr) {
|
||||
*pRamp = {};
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_small_swapchain(iSwapChain))
|
||||
{
|
||||
pReal->GetGammaRamp(GFDM_NATIVE_SMALL_SWAPCHAIN, pRamp);
|
||||
return;
|
||||
}
|
||||
|
||||
pReal->GetGammaRamp(iSwapChain, pRamp);
|
||||
}
|
||||
|
||||
@@ -685,6 +862,19 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetFrontBufferData(
|
||||
IDirect3DSurface9 *pDestSurface)
|
||||
{
|
||||
WRAP_DEBUG;
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_side_swapchain(iSwapChain))
|
||||
{
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_small_swapchain(iSwapChain))
|
||||
{
|
||||
CHECK_RESULT(pReal->GetFrontBufferData(
|
||||
GFDM_NATIVE_SMALL_SWAPCHAIN,
|
||||
pDestSurface));
|
||||
}
|
||||
|
||||
CHECK_RESULT(pReal->GetFrontBufferData(iSwapChain, pDestSurface));
|
||||
}
|
||||
|
||||
@@ -1779,6 +1969,18 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::WaitForVBlank(
|
||||
WRAP_DEBUG;
|
||||
|
||||
assert(is_d3d9ex);
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_side_swapchain(iSwapChain))
|
||||
{
|
||||
return D3D_OK;
|
||||
}
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_small_swapchain(iSwapChain))
|
||||
{
|
||||
CHECK_RESULT(static_cast<IDirect3DDevice9Ex *>(pReal)->WaitForVBlank(
|
||||
GFDM_NATIVE_SMALL_SWAPCHAIN));
|
||||
}
|
||||
|
||||
CHECK_RESULT(static_cast<IDirect3DDevice9Ex *>(pReal)->WaitForVBlank(iSwapChain));
|
||||
}
|
||||
|
||||
@@ -1882,6 +2084,14 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::ResetEx(
|
||||
|
||||
log_misc("graphics::d3d9", "WrappedIDirect3DDevice9::ResetEx");
|
||||
|
||||
if (is_gfdm_two_head_exclusive()) {
|
||||
gfdm_disarm_present_mode_recovery();
|
||||
if (pPresentationParameters == nullptr) {
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
release_gfdm_hidden_side_swapchains();
|
||||
}
|
||||
|
||||
if (GRAPHICS_WINDOWED) {
|
||||
if (pPresentationParameters) {
|
||||
pPresentationParameters->Windowed = true;
|
||||
@@ -1898,13 +2108,115 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::ResetEx(
|
||||
}
|
||||
}
|
||||
|
||||
GfdmTwoHeadDeviceState gfdm_parameters(
|
||||
pPresentationParameters,
|
||||
pFullscreenDisplayMode,
|
||||
gfdm_logical_small_swapchain);
|
||||
if (is_gfdm_two_head_exclusive()) {
|
||||
HRESULT result = graphics_d3d9_gfdm_select_two_head_group_parameters(
|
||||
pPresentationParameters,
|
||||
pFullscreenDisplayMode,
|
||||
gfdm_parameters.native_presentation_parameters.data(),
|
||||
pFullscreenDisplayMode != nullptr
|
||||
? gfdm_parameters.native_fullscreen_display_modes.data()
|
||||
: nullptr,
|
||||
&gfdm_parameters.logical_small_swapchain,
|
||||
"ResetEx");
|
||||
if (FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
set_gfdm_logical_group_parameters(pPresentationParameters);
|
||||
gfdm_parameters.use_native_parameters();
|
||||
if (gfdm_parameters.native_presentation_parameters[0].Windowed
|
||||
|| gfdm_parameters.native_presentation_parameters[1].Windowed)
|
||||
{
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
if (GRAPHICS_FORCE_REFRESH_SUB.has_value()) {
|
||||
gfdm_parameters.native_presentation_parameters[1]
|
||||
.FullScreen_RefreshRateInHz =
|
||||
GRAPHICS_FORCE_REFRESH_SUB.value();
|
||||
if (gfdm_parameters.fullscreen_display_modes != nullptr) {
|
||||
gfdm_parameters.fullscreen_display_modes[1].RefreshRate =
|
||||
GRAPHICS_FORCE_REFRESH_SUB.value();
|
||||
}
|
||||
}
|
||||
result = graphics_d3d9_gfdm_remap_two_head_group_parameters(
|
||||
gfdm_parameters.native_presentation_parameters.data(),
|
||||
gfdm_parameters.fullscreen_display_modes,
|
||||
"ResetEx");
|
||||
if (FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
if (!graphics_gitadora_prepare_two_head_device_window(
|
||||
gfdm_parameters.native_presentation_parameters[1].hDeviceWindow,
|
||||
nullptr,
|
||||
gfdm_parameters.native_presentation_parameters[1].BackBufferWidth,
|
||||
gfdm_parameters.native_presentation_parameters[1].BackBufferHeight))
|
||||
{
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
if (gfdm_parameters.fullscreen_display_modes != nullptr) {
|
||||
IDirect3D9 *raw_d3d = nullptr;
|
||||
IDirect3D9Ex *raw_d3d_ex = nullptr;
|
||||
D3DDEVICE_CREATION_PARAMETERS creation {};
|
||||
HRESULT raw_result = pReal->GetDirect3D(&raw_d3d);
|
||||
if (SUCCEEDED(raw_result) && raw_d3d != nullptr) {
|
||||
raw_result = raw_d3d->QueryInterface(IID_PPV_ARGS(&raw_d3d_ex));
|
||||
}
|
||||
if (SUCCEEDED(raw_result)) {
|
||||
raw_result = pReal->GetCreationParameters(&creation);
|
||||
}
|
||||
if (SUCCEEDED(raw_result) && raw_d3d_ex != nullptr) {
|
||||
graphics_d3d9_gfdm_align_two_head_refresh_to_desktop(
|
||||
raw_d3d_ex,
|
||||
creation.AdapterOrdinal,
|
||||
gfdm_parameters.native_presentation_parameters.data(),
|
||||
gfdm_parameters.fullscreen_display_modes,
|
||||
"ResetEx");
|
||||
}
|
||||
if (raw_d3d_ex != nullptr) {
|
||||
raw_d3d_ex->Release();
|
||||
}
|
||||
if (raw_d3d != nullptr) {
|
||||
raw_d3d->Release();
|
||||
}
|
||||
gfdm_parameters.recovery_parameters =
|
||||
gfdm_parameters.native_presentation_parameters;
|
||||
gfdm_parameters.recovery_modes =
|
||||
gfdm_parameters.native_fullscreen_display_modes;
|
||||
gfdm_parameters.recovery_candidate = true;
|
||||
}
|
||||
}
|
||||
|
||||
// reset overlay
|
||||
if (overlay::OVERLAY && overlay::OVERLAY->uses_device(pReal)) {
|
||||
overlay::OVERLAY->reset_invalidate();
|
||||
}
|
||||
|
||||
HRESULT res = static_cast<IDirect3DDevice9Ex *>(pReal)->ResetEx(
|
||||
pPresentationParameters, pFullscreenDisplayMode);
|
||||
gfdm_parameters.presentation_parameters,
|
||||
gfdm_parameters.fullscreen_display_modes);
|
||||
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& SUCCEEDED(res)
|
||||
&& gfdm_parameters.recovery_candidate)
|
||||
{
|
||||
gfdm_arm_present_mode_recovery(
|
||||
gfdm_parameters.recovery_parameters.data(),
|
||||
gfdm_parameters.recovery_modes.data());
|
||||
}
|
||||
if (is_gfdm_two_head_exclusive() && SUCCEEDED(res)) {
|
||||
gfdm_logical_small_swapchain = gfdm_parameters.logical_small_swapchain;
|
||||
pPresentationParameters[0] = gfdm_parameters.presentation_parameters[0];
|
||||
pPresentationParameters[gfdm_parameters.logical_small_swapchain] =
|
||||
gfdm_parameters.presentation_parameters[1];
|
||||
if (pFullscreenDisplayMode != nullptr) {
|
||||
pFullscreenDisplayMode[0] = gfdm_parameters.fullscreen_display_modes[0];
|
||||
pFullscreenDisplayMode[gfdm_parameters.logical_small_swapchain] =
|
||||
gfdm_parameters.fullscreen_display_modes[1];
|
||||
}
|
||||
}
|
||||
|
||||
// recreate overlay
|
||||
if (overlay::OVERLAY && overlay::OVERLAY->uses_device(pReal) && SUCCEEDED(res)) {
|
||||
@@ -1922,6 +2234,22 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetDisplayModeEx(
|
||||
WRAP_DEBUG;
|
||||
|
||||
assert(is_d3d9ex);
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_side_swapchain(iSwapChain))
|
||||
{
|
||||
return ensure_gfdm_hidden_side_swapchain(iSwapChain)->GetDisplayModeEx(
|
||||
pMode,
|
||||
pRotation);
|
||||
}
|
||||
if (is_gfdm_two_head_exclusive()
|
||||
&& is_gfdm_logical_small_swapchain(iSwapChain))
|
||||
{
|
||||
CHECK_RESULT(static_cast<IDirect3DDevice9Ex *>(pReal)->GetDisplayModeEx(
|
||||
GFDM_NATIVE_SMALL_SWAPCHAIN,
|
||||
pMode,
|
||||
pRotation));
|
||||
}
|
||||
|
||||
CHECK_RESULT(static_cast<IDirect3DDevice9Ex *>(pReal)->GetDisplayModeEx(
|
||||
iSwapChain, pMode, pRotation));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user