diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-09 16:24:13 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-09 16:24:13 -0700 |
commit | baf91b75b1e9a775b4cbc77daaf7c4e12a1a7f46 (patch) | |
tree | ff48b8b3db3aa48aae31e53e0268e518f050c2a8 | |
parent | a091408336198a95858e31a2b90f363765338ef1 (diff) |
createBuffer, bindBuffer
-rw-r--r-- | src/webGLClient.js | 1 | ||||
-rw-r--r-- | src/webGLWorker.js | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/webGLClient.js b/src/webGLClient.js index b0adb478..2028d1dc 100644 --- a/src/webGLClient.js +++ b/src/webGLClient.js @@ -13,6 +13,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; } } diff --git a/src/webGLWorker.js b/src/webGLWorker.js index 88327cf9..39ee97e5 100644 --- a/src/webGLWorker.js +++ b/src/webGLWorker.js @@ -573,6 +573,14 @@ function WebGLWorker() { this.uniform4fv = function(location, data) { commandBuffer.push('uniform4fv', 2, location.id, data); }; + this.createBuffer = function() { + var id = nextId++; + commandBuffer.push('createBuffer', -1, id); + return { what: 'buffer', id: id }; + }; + this.bindBuffer = function(target, buffer) { + commandBuffer.push('bindBuffer', target, buffer.id); + }; // Setup var postMainLoop = Module['postMainLoop']; |