diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-06 16:34:09 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-06 16:34:09 -0700 |
commit | 9d2476894382e8e71aff70f32d0c32cc9bad1b55 (patch) | |
tree | 9b57ae0f5a5a178ace939980c5bb35a58ff69b5d /src | |
parent | 8aee2b822c689902d9a627393252eea117ac7969 (diff) |
clear, createShader
Diffstat (limited to 'src')
-rw-r--r-- | src/webGLWorker.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/webGLWorker.js b/src/webGLWorker.js index c0efcbc9..08b72e01 100644 --- a/src/webGLWorker.js +++ b/src/webGLWorker.js @@ -10,6 +10,8 @@ function WebGLWorker() { var commandBuffer = []; + var nextId = 1; + //=========== // Constants //=========== @@ -480,9 +482,16 @@ function WebGLWorker() { this.disable = function(cap) { commandBuffer.push('disable', 1, cap); }; + this.clear = function(mask) { + commandBuffer.push('clear', 1, mask); + }; this.clearColor = function(r, g, b, a) { commandBuffer.push('clearColor', 4, r, g, b, a); }; + this.createShader = function(type) { + commandBuffer.push('createShader', 1, type); + return { id: nextId++, what: 'shader', type: type }; + } // Setup var postMainLoop = Module['postMainLoop']; |