David Catuhe 8 vuotta sitten
vanhempi
commit
5d19fb2608

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 11034 - 11030
dist/preview release/babylon.d.ts


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3 - 3
dist/preview release/babylon.js


+ 10 - 2
dist/preview release/babylon.max.js

@@ -7460,6 +7460,10 @@ var BABYLON;
             this._performanceMonitor = new BABYLON.PerformanceMonitor();
             this._fps = 60;
             this._deltaTime = 0;
+            /**
+             * Turn this value on if you want to pause FPS computation when in background
+             */
+            this.disablePerformanceMonitorInBackground = false;
             // States
             this._depthCullingState = new BABYLON.Internals._DepthCullingState();
             this._stencilState = new BABYLON.Internals._StencilState();
@@ -7552,11 +7556,15 @@ var BABYLON;
                     throw new Error("WebGL not supported");
                 }
                 this._onBlur = function () {
-                    _this._performanceMonitor.disable();
+                    if (_this.disablePerformanceMonitorInBackground) {
+                        _this._performanceMonitor.disable();
+                    }
                     _this._windowIsBackground = true;
                 };
                 this._onFocus = function () {
-                    _this._performanceMonitor.enable();
+                    if (_this.disablePerformanceMonitorInBackground) {
+                        _this._performanceMonitor.enable();
+                    }
                     _this._windowIsBackground = false;
                 };
                 this._onCanvasBlur = function () {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 11034 - 11030
dist/preview release/babylon.module.d.ts


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3 - 3
dist/preview release/babylon.worker.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1558 - 1554
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3 - 3
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 10 - 2
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -7460,6 +7460,10 @@ var BABYLON;
             this._performanceMonitor = new BABYLON.PerformanceMonitor();
             this._fps = 60;
             this._deltaTime = 0;
+            /**
+             * Turn this value on if you want to pause FPS computation when in background
+             */
+            this.disablePerformanceMonitorInBackground = false;
             // States
             this._depthCullingState = new BABYLON.Internals._DepthCullingState();
             this._stencilState = new BABYLON.Internals._StencilState();
@@ -7552,11 +7556,15 @@ var BABYLON;
                     throw new Error("WebGL not supported");
                 }
                 this._onBlur = function () {
-                    _this._performanceMonitor.disable();
+                    if (_this.disablePerformanceMonitorInBackground) {
+                        _this._performanceMonitor.disable();
+                    }
                     _this._windowIsBackground = true;
                 };
                 this._onFocus = function () {
-                    _this._performanceMonitor.enable();
+                    if (_this.disablePerformanceMonitorInBackground) {
+                        _this._performanceMonitor.enable();
+                    }
                     _this._windowIsBackground = false;
                 };
                 this._onCanvasBlur = function () {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1558 - 1554
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


+ 10 - 2
src/babylon.engine.ts

@@ -591,6 +591,10 @@
         private _performanceMonitor = new PerformanceMonitor();
         private _fps = 60;
         private _deltaTime = 0;
+        /**
+         * Turn this value on if you want to pause FPS computation when in background
+         */
+        public disablePerformanceMonitorInBackground = false;
 
         public get performanceMonitor(): PerformanceMonitor {
             return this._performanceMonitor;
@@ -740,12 +744,16 @@
                 }
 
                 this._onBlur = () => {
-                    this._performanceMonitor.disable();
+                    if (this.disablePerformanceMonitorInBackground) {
+                        this._performanceMonitor.disable();
+                    }
                     this._windowIsBackground = true;
                 };
 
                 this._onFocus = () => {
-                    this._performanceMonitor.enable();
+                    if (this.disablePerformanceMonitorInBackground) {
+                        this._performanceMonitor.enable();
+                    }
                     this._windowIsBackground = false;
                 };