aboutsummaryrefslogtreecommitdiff
path: root/src/webGLWorker.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-06-13 12:31:02 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-06-13 12:31:02 -0700
commitb04bfab6e27d08722ab09aed0426baec3fdcc8ce (patch)
tree134c75d17fceb1d595870190675d377ed39c5e10 /src/webGLWorker.js
parent80def15592ce9d96209cd2c68ec3b57151fb6cfa (diff)
bindBuffer of null; getError
Diffstat (limited to 'src/webGLWorker.js')
-rw-r--r--src/webGLWorker.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/webGLWorker.js b/src/webGLWorker.js
index f7058a51..46674b01 100644
--- a/src/webGLWorker.js
+++ b/src/webGLWorker.js
@@ -582,7 +582,7 @@ function WebGLWorker() {
return { what: 'buffer', id: id };
};
this.bindBuffer = function(target, buffer) {
- commandBuffer.push('bindBuffer', 2, target, buffer.id);
+ commandBuffer.push('bindBuffer', 2, target, buffer ? buffer.id : 0);
};
this.bufferData = function(target, something, usage) {
if (typeof something !== 'number') something = new Uint8Array(something);
@@ -603,6 +603,11 @@ function WebGLWorker() {
this.drawArrays = function(mode, first, count) {
commandBuffer.push('drawArrays', 3, mode, first, count);
};
+ this.getError = function() {
+ // optimisticaly return success; client will abort on an actual error. we assume an error-free async workflow
+ commandBuffer.push('getError', 0);
+ return this.NO_ERROR;
+ };
// Setup
var dropped = 0;