diff --git a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx b/panda/src/dxgsg/dxGraphicsStateGuardian.cxx index 8b083e3cd0..a0c73e9f50 100644 --- a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx +++ b/panda/src/dxgsg/dxGraphicsStateGuardian.cxx @@ -6522,12 +6522,7 @@ void DXGraphicsStateGuardian::show_full_screen_frame(void) { // Flip the front and back buffers, to make what we just rendered // visible. - if (_overlay_windows_supported) { - // If we're asking for overlay windows, we have to blt instead of - // flip, so we don't lose the window. - hr = scrn.pddsPrimary->Blt( NULL, scrn.pddsBack, NULL, DDBLT_WAIT, NULL ); - - } else { + if(!_overlay_windows_supported) { // Normally, we can just do the fast flip operation. DWORD dwFlipFlags = DDFLIP_WAIT; @@ -6544,17 +6539,20 @@ void DXGraphicsStateGuardian::show_full_screen_frame(void) { // bugbug: dont we want triple buffering instead of wasting time // waiting for vsync? hr = scrn.pddsPrimary->Flip( NULL, dwFlipFlags); + } else { + // If we're asking for overlay windows, we have to blt instead of + // flip, so we don't lose the window. + hr = scrn.pddsPrimary->Blt( NULL, scrn.pddsBack, NULL, DDBLT_WAIT, NULL ); + } - if(FAILED(hr)) { + if(FAILED(hr)) { if((hr == DDERR_SURFACELOST) || (hr == DDERR_SURFACEBUSY)) { CheckCooperativeLevel(); } else { dxgsg_cat.error() << "show_frame() - Flip failed w/unexpected error code: " << ConvD3DErrorToString(hr) << endl; exit(1); } - } } - } ////////////////////////////////////////////////////////////////////