Browse Source

check for loadcubetexture

Cedric Guillemet 5 years ago
parent
commit
6e62ac71da
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/Engines/nativeEngine.ts

+ 4 - 2
src/Engines/nativeEngine.ts

@@ -1075,8 +1075,10 @@ export class NativeEngine extends Engine {
                 texture.getEngine().updateTextureSamplingMode(Texture.TRILINEAR_SAMPLINGMODE, texture);
                 texture._isRGBD = true;
                 texture.invertY = true;
-                this._native.loadCubeTexture(texture._webGLTexture!, imageData, true);
-
+                let nativeHandle = this._native.loadCubeTexture(texture._webGLTexture!, imageData, true);
+                if (nativeHandle === this.INVALID_HANDLE) {
+                    throw new Error("Could not load a native cube texture.");
+                }
                 texture.isReady = true;
                 if (onLoad) {
                     onLoad();