aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-22 17:09:41 -0500
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-22 17:11:14 -0500
commitc309d638f66c6b586ceb1cfa1e41076f02f9620d (patch)
treeb1f094f90c4422ce4e5881e1f5b64550d07b8967 /src
parent6db298e3ddebf0e0aad05fd70e9e56baf8c0bfac (diff)
Implement the GL vertexAttrib functons
Diffstat (limited to 'src')
-rw-r--r--src/library_gl.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 055f5782..e73ff776 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -190,6 +190,54 @@ var LibraryGL = {
Module.ctx.bindBuffer(target, GL.buffers[buffer]);
},
+ glVertexAttrib1f: function(index, v0) {
+ Module.ctx.vertexAttrib1f(index, v0);
+ },
+
+ glVertexAttrib2f: function(index, v0, v1) {
+ Module.ctx.vertexAttrib2f(index, v0, v1);
+ },
+
+ glVertexAttrib3f: function(index, v0, v1, v2) {
+ Module.ctx.vertexAttrib3f(index, v0, v1, v2);
+ },
+
+ glVertexAttrib4f: function(index, v0, v1, v2, v3) {
+ Module.ctx.vertexAttrib4f(index, v0, v1, v2, v3);
+ },
+
+ glVertexAttrib1fv: function(index, v) {
+ v = new Float32Array(IHEAP.slice(v, value + 1*4)); // TODO: optimize
+ Module.ctx.vertexAttrib1fv(index, v);
+ },
+
+ glVertexAttrib2fv: function(index, v) {
+ v = new Float32Array(IHEAP.slice(v, value + 2*4)); // TODO: optimize
+ Module.ctx.vertexAttrib2fv(index, v);
+ },
+
+ glVertexAttrib3fv: function(index, v) {
+ v = new Float32Array(IHEAP.slice(v, value + 3*4)); // TODO: optimize
+ Module.ctx.vertexAttrib3fv(index, v);
+ },
+
+ glVertexAttrib4fv: function(index, v) {
+ v = new Float32Array(IHEAP.slice(v, value + 4*4)); // TODO: optimize
+ Module.ctx.vertexAttrib4fv(index, v);
+ },
+
+ glVertexAttribPointer: function(index, size, type, normalized, stride, pointer) {
+ Module.ctx.vertexAttribPointer(index, size, type, normalized, stride, pointer);
+ },
+
+ glEnableVertexAttribArray: function(index) {
+ Module.ctx.enableVertexAttribArray(index);
+ },
+
+ glDisableVertexAttribArray: function(index) {
+ Module.ctx.disableVertexAttribArray(index);
+ },
+
glClearColor: function(red, green, blue, alpha) {
Module.ctx.clearColor(red, green, blue, alpha);
},