浏览代码

handle offset in pixels bytes

Nicolas Cannasse 8 年之前
父节点
当前提交
724c77902b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      h3d/impl/GlDriver.hx

+ 1 - 1
h3d/impl/GlDriver.hx

@@ -795,7 +795,7 @@ class GlDriver extends Driver {
 		pixels.convert(t.format);
 		pixels.convert(t.format);
 		#if hxsdl
 		#if hxsdl
 		pixels.setFlip(!cubic);
 		pixels.setFlip(!cubic);
-		gl.texImage2D(face, mipLevel, t.t.internalFmt, pixels.width, pixels.height, 0, getChannels(t.t), t.t.pixelFmt, streamData(pixels.bytes.getData(),0,pixels.width*pixels.height*4));
+		gl.texImage2D(face, mipLevel, t.t.internalFmt, pixels.width, pixels.height, 0, getChannels(t.t), t.t.pixelFmt, streamData(pixels.bytes.getData(),pixels.offset,pixels.width*pixels.height*4));
 		#elseif lime
 		#elseif lime
 		pixels.setFlip(!cubic);
 		pixels.setFlip(!cubic);
 		gl.texImage2D(face, mipLevel, t.t.internalFmt, pixels.width, pixels.height, 0, getChannels(t.t), t.t.pixelFmt, bytesToUint8Array(pixels.bytes));
 		gl.texImage2D(face, mipLevel, t.t.internalFmt, pixels.width, pixels.height, 0, getChannels(t.t), t.t.pixelFmt, bytesToUint8Array(pixels.bytes));