mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 11:28:17 -04:00
fixed the window maximize/minimize bug on toontown
This commit is contained in:
parent
5faa4ffb7e
commit
2e85d47cd2
@ -4839,8 +4839,15 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *pPresParams, DXScreenData **pScrn) {
|
|||||||
|
|
||||||
get_engine()->reset_all_windows(false);// reset old swapchain by releasing
|
get_engine()->reset_all_windows(false);// reset old swapchain by releasing
|
||||||
|
|
||||||
|
if (_pScrn->pSwapChain) { //other windows might be using bigger buffers
|
||||||
_PresReset.BackBufferWidth = max(_PresReset.BackBufferWidth, pPresParams->BackBufferWidth);
|
_PresReset.BackBufferWidth = max(_PresReset.BackBufferWidth, pPresParams->BackBufferWidth);
|
||||||
_PresReset.BackBufferHeight = max(_PresReset.BackBufferHeight, pPresParams->BackBufferHeight);
|
_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);
|
hr=_pD3DDevice->Reset(&_PresReset);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -4839,8 +4839,15 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *pPresParams, DXScreenData **pScrn) {
|
|||||||
|
|
||||||
get_engine()->reset_all_windows(false);// reset old swapchain by releasing
|
get_engine()->reset_all_windows(false);// reset old swapchain by releasing
|
||||||
|
|
||||||
|
if (_pScrn->pSwapChain) { //other windows might be using bigger buffers
|
||||||
_PresReset.BackBufferWidth = max(_PresReset.BackBufferWidth, pPresParams->BackBufferWidth);
|
_PresReset.BackBufferWidth = max(_PresReset.BackBufferWidth, pPresParams->BackBufferWidth);
|
||||||
_PresReset.BackBufferHeight = max(_PresReset.BackBufferHeight, pPresParams->BackBufferHeight);
|
_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);
|
hr=_pD3DDevice->Reset(&_PresReset);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
return hr;
|
return hr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user