diff options
Diffstat (limited to 'src/library_gl.js')
-rw-r--r-- | src/library_gl.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 3055309b..0a30292a 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -957,7 +957,11 @@ var LibraryGL = { usage = 0x88E8; // GL_DYNAMIC_DRAW break; } - GLctx.bufferData(target, HEAPU8.subarray(data, data+size), usage); + if (!data) { + GLctx.bufferData(target, size, usage); + } else { + GLctx.bufferData(target, HEAPU8.subarray(data, data+size), usage); + } }, glBufferSubData__sig: 'viiii', |