From 2e85d47cd29c693ea7bac10530d0f67a1c95d78c Mon Sep 17 00:00:00 2001 From: "Asad M. Zaman" Date: Thu, 18 Mar 2004 22:22:03 +0000 Subject: [PATCH] fixed the window maximize/minimize bug on toontown --- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 11 +++++++++-- panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index c9bd9bf576..c5fbfe1faf 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -4839,8 +4839,15 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *pPresParams, DXScreenData **pScrn) { get_engine()->reset_all_windows(false);// reset old swapchain by releasing - _PresReset.BackBufferWidth = max(_PresReset.BackBufferWidth, pPresParams->BackBufferWidth); - _PresReset.BackBufferHeight = max(_PresReset.BackBufferHeight, pPresParams->BackBufferHeight); + if (_pScrn->pSwapChain) { //other windows might be using bigger buffers + _PresReset.BackBufferWidth = max(_PresReset.BackBufferWidth, pPresParams->BackBufferWidth); + _PresReset.BackBufferHeight = max(_PresReset.BackBufferHeight, pPresParams->BackBufferHeight); + } + else { // single window, must reset to the new pPresParams dimension + _PresReset.BackBufferWidth = pPresParams->BackBufferWidth; + _PresReset.BackBufferHeight = pPresParams->BackBufferHeight; + } + hr=_pD3DDevice->Reset(&_PresReset); if (FAILED(hr)) { return hr; diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 95d4d4fdaf..a13535969e 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -4839,8 +4839,15 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *pPresParams, DXScreenData **pScrn) { get_engine()->reset_all_windows(false);// reset old swapchain by releasing - _PresReset.BackBufferWidth = max(_PresReset.BackBufferWidth, pPresParams->BackBufferWidth); - _PresReset.BackBufferHeight = max(_PresReset.BackBufferHeight, pPresParams->BackBufferHeight); + if (_pScrn->pSwapChain) { //other windows might be using bigger buffers + _PresReset.BackBufferWidth = max(_PresReset.BackBufferWidth, pPresParams->BackBufferWidth); + _PresReset.BackBufferHeight = max(_PresReset.BackBufferHeight, pPresParams->BackBufferHeight); + } + else { // single window, must reset to the new pPresParams dimension + _PresReset.BackBufferWidth = pPresParams->BackBufferWidth; + _PresReset.BackBufferHeight = pPresParams->BackBufferHeight; + } + hr=_pD3DDevice->Reset(&_PresReset); if (FAILED(hr)) { return hr;