Browse Source

check for loadcubetexture

Cedric Guillemet 5 năm trước cách đây
mục cha
commit
6e62ac71da
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  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();