diff options
Diffstat (limited to 'src/webGLClient.js')
-rw-r--r-- | src/webGLClient.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/webGLClient.js b/src/webGLClient.js index 02756ddb..a0cc7b7d 100644 --- a/src/webGLClient.js +++ b/src/webGLClient.js @@ -2,6 +2,16 @@ function WebGLClient() { function renderCommands(buffer) { + var ctx = Module.ctx; + var i = 0; + var len = buffer.length; + while (i < len) { + var command = buffer[i++]; + var numArgs = buffer[i++]; + var args = buffer.slice(i, i+numArgs); + i += numArgs; + ctx[command].apply(ctx, args); + } } this.onmessage = function(msg) { |