Преглед изворни кода

restore Alt-tab handling for fullscreen Bltflip

cxgeorge пре 24 година
родитељ
комит
f2bd33cd7c
1 измењених фајлова са 7 додато и 9 уклоњено
  1. 7 9
      panda/src/dxgsg/dxGraphicsStateGuardian.cxx

+ 7 - 9
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);
       }
-    }
   }
-
 }
 
 ////////////////////////////////////////////////////////////////////