diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2012-03-28 01:11:06 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2012-03-28 01:11:06 -0400 |
commit | bb2392b66d59097593e3101057e773c72c461032 (patch) | |
tree | a83fa2d9909f61787291ea1b04880e7de88537da /src/library_gl.js | |
parent | 378df670293f125dfe6bb22c5a2ee5890fd44df4 (diff) |
Fix glTexImage2D() issue with Firefox where pixels is null
Diffstat (limited to 'src/library_gl.js')
-rw-r--r-- | src/library_gl.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 8db2c8b6..32457b01 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -73,6 +73,8 @@ var LibraryGL = { glTexImage2D: function(target, level, internalformat, width, height, border, format, type, pixels) { if (pixels) { pixels = new Uint8Array(Array_copy(pixels, pixels + width*height*4)); // TODO: optimize + } else { + pixels = new Uint8Array (width*height*4); } Module.ctx.texImage2D(target, level, internalformat, width, height, border, format, type, pixels); }, |