Parcourir la source

Fix engine initialization issue

David Catuhe il y a 5 ans
Parent
commit
294616120a
2 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 1 1
      src/Engines/engine.ts
  2. 2 0
      src/Engines/thinEngine.ts

+ 1 - 1
src/Engines/engine.ts

@@ -477,7 +477,7 @@ export class Engine extends ThinEngine {
             return;
         }
 
-        options = options || {};
+        options = this._creationOptions;
 
         Engine.Instances.push(this);
 

+ 2 - 0
src/Engines/thinEngine.ts

@@ -226,6 +226,7 @@ export class ThinEngine {
     protected _renderingCanvas: Nullable<HTMLCanvasElement>;
     protected _windowIsBackground = false;
     protected _webGLVersion = 1.0;
+    protected _creationOptions: EngineOptions;
 
     protected _highPrecisionShadersAllowed = true;
     /** @hidden */
@@ -640,6 +641,7 @@ export class ThinEngine {
         // Detect if we are running on a faulty buggy desktop OS.
         this._badDesktopOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
 
+        this._creationOptions = options;
         console.log(`Babylon.js v${ThinEngine.Version} - ${this.description}`);
     }