diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-07-12 12:22:12 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-07-12 12:22:12 -0700 |
commit | 733914ce08ac55dcdeea7d610343bd8e963c26fb (patch) | |
tree | 3ff82e233aeeccf6b4710de95c69f11f3efb793e | |
parent | 1aba28b2260192a50f912e579abe587357ef2468 (diff) |
treat pixels of 0 as null in texImage2D
-rw-r--r-- | src/library_gl.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index d5ce4aaa..f3cea384 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -376,6 +376,8 @@ var LibraryGL = { var data = GL.getTexPixelData(type, format, width, height, pixels, internalFormat); pixels = data.pixels; internalFormat = data.internalFormat; + } else { + pixels = null; } Module.ctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixels); }, @@ -384,6 +386,8 @@ var LibraryGL = { if (pixels) { var data = GL.getTexPixelData(type, format, width, height, pixels, -1); pixels = data.pixels; + } else { + pixels = null; } Module.ctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); }, |