diff options
author | Anthony Pesch <inolen@gmail.com> | 2014-01-23 16:49:56 -0800 |
---|---|---|
committer | Anthony Pesch <inolen@gmail.com> | 2014-01-23 17:56:40 -0800 |
commit | 958492b5ef450407e2a29380a67534d876403b97 (patch) | |
tree | 7f198f30ccd9fb5cd981dae9c81c6e1fcbbf1d56 /src | |
parent | c99a28dedf06cd1114f0b4f782b2e1e1d6c10051 (diff) |
use correct bufferData method when passing a NULL pointer
Diffstat (limited to 'src')
-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', |