aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-06-16 16:27:56 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-06-16 16:27:56 -0700
commit72c090f1336d6e07871ed9a96503d1c86f9c30f5 (patch)
tree565d9c0dcd585c20e40029d6b96211d481c4bdfe
parented05713a09c2c5cce8dfc5fa2dec28dab63666cf (diff)
deleteShader, deleteProgram
-rw-r--r--src/webGLClient.js2
-rw-r--r--src/webGLWorker.js6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/webGLClient.js b/src/webGLClient.js
index a5ec0f4f..335c836c 100644
--- a/src/webGLClient.js
+++ b/src/webGLClient.js
@@ -9,6 +9,8 @@ function WebGLClient() {
function fixArgs(command, args) {
switch (command) {
+ case 'deleteShader':
+ case 'deleteProgram':
case 'getProgramParameter':
case 'getShaderParameter':
case 'uniform1i':
diff --git a/src/webGLWorker.js b/src/webGLWorker.js
index 86bdf206..eb20b89e 100644
--- a/src/webGLWorker.js
+++ b/src/webGLWorker.js
@@ -526,6 +526,9 @@ function WebGLWorker() {
commandBuffer.push('createShader', -2, type, id);
return { id: id, what: 'shader', type: type };
};
+ this.deleteShader = function(shader) {
+ commandBuffer.push('deleteShader', 1, shader.id);
+ };
this.shaderSource = function(shader, source) {
shader.source = source;
commandBuffer.push('shaderSource', 2, shader.id, source);
@@ -541,6 +544,9 @@ function WebGLWorker() {
commandBuffer.push('createProgram', -1, id);
return new WebGLProgram(id);
};
+ this.deleteProgram = function(program) {
+ commandBuffer.push('deleteProgram', 1, program.id);
+ };
this.attachShader = function(program, shader) {
program.shaders.push(shader);
commandBuffer.push('attachShader', 2, program.id, shader.id);