瀏覽代碼

Merge branch 'native' into native-textures

Scott Ramsby 7 年之前
父節點
當前提交
bbcd70d648

+ 5 - 5
src/Engine/babylon.nativeEngineWrapper.ts

@@ -40,6 +40,9 @@
         draw(fillMode: number, vertexStart: number, vertexCount: number): void;
 
         clear(r: number, g: number, b: number, a: number, backBuffer: boolean, depth: boolean, stencil: boolean): void;
+
+        getRenderWidth(): number;
+        getRenderHeight(): number;
     }
 
     class NativeSamplingMode {
@@ -66,9 +69,6 @@
 
     /** @hidden */
     export class NativeEngineWrapperOptions {
-        public renderWidth = 1024;
-        public renderHeight = 768;
-
         public textureSize = 512;
 
         public deterministicLockstep = false;
@@ -371,7 +371,7 @@
                 return this._currentRenderTarget.width;
             }
 
-            return this._options.renderWidth;
+            return this._interop.getRenderWidth();
         }
 
         public getRenderHeight(useScreen = false): number {
@@ -379,7 +379,7 @@
                 return this._currentRenderTarget.height;
             }
 
-            return this._options.renderHeight;
+            return this._interop.getRenderHeight();
         }
 
         public setViewport(viewport: Viewport, requiredWidth?: number, requiredHeight?: number): void {

+ 2 - 1
src/Engine/babylon.nullEngine.ts

@@ -440,9 +440,10 @@
         protected _bindTextureDirectly(target: number, texture: InternalTexture): boolean {
             if (this._boundTexturesCache[this._activeChannel] !== texture) {
                 this._boundTexturesCache[this._activeChannel] = texture;
+                return false;
+            } else {
                 return true;
             }
-            return false;
         }
 
         /** @hidden */

+ 1 - 1
src/Materials/Textures/babylon.internalTextureLoader.ts

@@ -11,7 +11,7 @@ module BABYLON {
         /**
          * This returns if the loader support the current file information.
          * @param extension defines the file extension of the file being loaded
-         * @param textureFormatInUse defines the current compressed format in use iun the engine
+         * @param textureFormatInUse defines the current compressed format in use in the engine
          * @param fallback defines the fallback internal texture if any
          * @param isBase64 defines whether the texture is encoded as a base64
          * @param isBuffer defines whether the texture data are stored as a buffer