Jelajahi Sumber

fallback when an error occurs while resizing the back buffer to >2048

ncannasse 10 tahun lalu
induk
melakukan
148254faac
1 mengubah file dengan 7 tambahan dan 1 penghapusan
  1. 7 1
      h3d/impl/Stage3dDriver.hx

+ 7 - 1
h3d/impl/Stage3dDriver.hx

@@ -168,7 +168,13 @@ class Stage3dDriver extends Driver {
 			this.width = width;
 			this.height = height;
 		} catch( e : flash.errors.Error ) {
-			throw new flash.errors.Error("" + e+" (" + width + "x" + height + ")");
+			// large screen but bad video card ?
+			if( width > 2048 || height > 2048 ) {
+				if( width > 2048 ) width = 2048;
+				if( height > 2048 ) height = 2048;
+				resize(width, height);
+			} else
+				throw new flash.errors.Error("" + e+" (" + width + "x" + height + ")");
 		}
 	}