Skip to content

Commit a4597d4

Browse files
committed
Restoring GL live resizing on MSW - D3D12 retains same behavior
1 parent 388ba24 commit a4597d4

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/cinder/app/msw/AppImplMsw.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -781,13 +781,11 @@ LRESULT CALLBACK WndProc( HWND mWnd, // Handle For This Window
781781
impl->mWindowWidthPx = LOWORD(lParam);
782782
impl->mWindowHeightPx = HIWORD(lParam);
783783
if( impl->getWindow() && impl->mAppImpl->setupHasBeenCalled() ) {
784+
// If we're in a size/move loop and receiving WM_SIZE, we're resizing (not just moving)
784785
if( impl->mInSizeMoveLoop ) {
785786
impl->setResizing( true );
786-
// During live resize, defer swap chain resize to WM_EXITSIZEMOVE
787-
}
788-
else {
789-
impl->getWindow()->emitResize();
790787
}
788+
impl->getWindow()->emitResize();
791789
}
792790
return 0;
793791
break;
@@ -806,17 +804,17 @@ LRESULT CALLBACK WndProc( HWND mWnd, // Handle For This Window
806804
return 0;
807805
}
808806
break;
809-
case WM_EXITSIZEMOVE:
807+
case WM_EXITSIZEMOVE: {
810808
if( impl->getWindow() ) {
811809
// Only emit postResize if we were actually resizing (not just moving)
812810
if( impl->getWindow()->isResizing() ) {
813-
impl->getWindow()->emitResize();
814811
impl->handlePostResize();
815812
}
816813
impl->setResizing( false );
817814
}
818815
impl->mInSizeMoveLoop = false;
819816
return 0;
817+
}
820818
break;
821819
case WM_DROPFILES: {
822820
HDROP dropH = (HDROP)wParam;

src/cinder/app/msw/RendererImplD3d12.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,11 @@ void RendererImplD3d12::defaultResize() const
658658
if( ! mSwapChain )
659659
return;
660660

661+
// Skip expensive swap chain resize during live resize
662+
// startDraw() will catch the size mismatch after resize ends
663+
if( App::get()->getWindow()->isResizing() )
664+
return;
665+
661666
RECT clientRect;
662667
::GetClientRect( mWnd, &clientRect );
663668
UINT width = clientRect.right - clientRect.left;

0 commit comments

Comments
 (0)