Bladeren bron

prevent crash with window-type offscreen

David Rose 17 jaren geleden
bovenliggende
commit
babf0163e5
2 gewijzigde bestanden met toevoegingen van 14 en 8 verwijderingen
  1. 7 4
      panda/src/dxgsg8/wdxGraphicsBuffer8.cxx
  2. 7 4
      panda/src/dxgsg9/wdxGraphicsBuffer9.cxx

+ 7 - 4
panda/src/dxgsg8/wdxGraphicsBuffer8.cxx

@@ -523,11 +523,14 @@ open_buffer() {
 
   // GSG creation/initialization.
   if (_gsg == 0) {
-    _dxgsg = new DXGraphicsStateGuardian8(_engine, _pipe);
-    _gsg = _dxgsg;
-  } else {
-    DCAST_INTO_R(_dxgsg, _gsg, false);
+    // The code below doesn't support creating a GSG on the fly.
+    // Just error out for now.
+    //_dxgsg = new DXGraphicsStateGuardian8(_engine, _pipe);
+    //_gsg = _dxgsg;
+    return false;
   }
+   
+  DCAST_INTO_R(_dxgsg, _gsg, false);
 
   if (!save_bitplanes()) {
     return false;

+ 7 - 4
panda/src/dxgsg9/wdxGraphicsBuffer9.cxx

@@ -745,11 +745,14 @@ open_buffer() {
 
   // GSG creation/initialization.
   if (_gsg == 0) {
-    _dxgsg = new DXGraphicsStateGuardian9(_engine, _pipe);
-    _gsg = _dxgsg;
-  } else {
-    DCAST_INTO_R(_dxgsg, _gsg, false);
+    // The code below doesn't support creating a GSG on the fly.
+    // Just error out for now.
+    //_dxgsg = new DXGraphicsStateGuardian9(_engine, _pipe);
+    //_gsg = _dxgsg;
+    return false;
   }
+   
+  DCAST_INTO_R(_dxgsg, _gsg, false);
 
   if (!save_bitplanes()) {
     return false;