aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2012-02-06 11:54:42 -0500
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2012-02-06 11:54:42 -0500
commit6424d34deb3adf068c17106094cca0898690e782 (patch)
tree5420394d1e26ead25d894214242ce8dd35abfa18
parent78a230ab665daad0fe11d40bdaca1c995fbe9add (diff)
Generate the body of some of the simple functions automatically
-rw-r--r--src/library_gl.js42
1 files changed, 6 insertions, 36 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index e1a7c73b..d19c7497 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -239,22 +239,6 @@ var LibraryGL = {
Module.ctx.bindBuffer(target, GL.hashtable("buffer").get(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(TypedArray_copy(v, 1*4)); // TODO: optimize
Module.ctx.vertexAttrib1fv(index, v);
@@ -275,22 +259,6 @@ var LibraryGL = {
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);
- },
-
- glDrawArrays: function(mode, first, count) {
- Module.ctx.drawArrays(mode, first, count);
- },
-
glGetAttribLocation: function(program, name) {
program = GL.hashtable("program").get(program);
name = Pointer_stringify(name);
@@ -387,10 +355,12 @@ var LibraryGL = {
// Simple pass-through functions
[[0, 'shadeModel fogi fogfv getError'],
- [1, 'clearDepth depthFunc enable disable frontFace cullFace clear'],
- [2, 'pixelStorei'],
- [3, 'texParameteri texParameterf'],
- [4, 'viewport clearColor scissor']].forEach(function(data) {
+ [1, 'clearDepth depthFunc enable disable frontFace cullFace clear enableVertexAttribArray disableVertexAttribArray'],
+ [2, 'pixelStorei vertexAttrib1f'],
+ [3, 'texParameteri texParameterf drawArrays vertexAttrib2f'],
+ [4, 'viewport clearColor scissor vertexAttrib3f'],
+ [5, 'vertexAttrib4f'],
+ [6, 'vertexAttribPointer']].forEach(function(data) {
var num = data[0];
var names = data[1];
var args = range(num).map(function(i) { return 'x' + i }).join(', ');