aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-01-23 19:32:48 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-01-23 19:32:48 -0800
commit42efac37f1866d2084a610b4161495efb36dca19 (patch)
tree69b1fecbc374149c9a41e1863229204d0211100a
parent44998c302a9cd458d57802129c0cbc9d61dc10e7 (diff)
parent958492b5ef450407e2a29380a67534d876403b97 (diff)
Merge pull request #2051 from inolen/invalidate_buffer_support
use correct bufferData method when passing a NULL pointer
-rw-r--r--src/library_gl.js6
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',