aboutsummaryrefslogtreecommitdiff
path: root/src/webGLClient.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/webGLClient.js
parent80def15592ce9d96209cd2c68ec3b57151fb6cfa (diff)
bindBuffer of null; getError
Diffstat (limited to 'src/webGLClient.js')
-rw-r--r--src/webGLClient.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/webGLClient.js b/src/webGLClient.js
index 10433729..f1657003 100644
--- a/src/webGLClient.js
+++ b/src/webGLClient.js
@@ -18,7 +18,7 @@ function WebGLClient() {
case 'compileShader':
case 'shaderSource': args[0] = objects[args[0]]; break;
case 'attachShader': args[0] = objects[args[0]]; args[1] = objects[args[1]]; break;
- case 'bindBuffer': args[1] = objects[args[1]]; break;
+ case 'bindBuffer': args[1] = args[1] ? objects[args[1]] : null; break;
}
return args;
}
@@ -35,7 +35,11 @@ function WebGLClient() {
//dump('issue ' + [command, numArgs, 'peek:' + buffer.slice(i, i+5)] + '\n');
if (numArgs === 0) {
//dump('issue: ' + command + '\n');
- ctx[command]();
+ if (command === 'getError') {
+ assert(ctx.getError() === ctx.NO_ERROR, 'we cannot handle errors, we are async proxied WebGL');
+ } else {
+ ctx[command]();
+ }
} else if (numArgs > 0) {
var args = fixArgs(command, buffer.slice(i, i+numArgs));
i += numArgs;