aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-12 11:48:07 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-12 11:48:07 -0700
commitc5dbf34c71d104a634b7dfe104d513677254e143 (patch)
treefe5ebb8f41509a12fa71936f791e0d83e43e6944
parent064b0c7d73876d06f625018f216d99f07cac2155 (diff)
fix return value for glCheckFramebufferStatus
-rw-r--r--src/library_gl.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 6c39e11d..7c5cca0b 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -844,9 +844,9 @@ var LibraryGL = {
}
};
-// Simple pass-through functions
+// Simple pass-through functions. Starred ones have return values.
[[0, 'shadeModel fogi fogfv getError finish flush'],
- [1, 'clearDepth depthFunc enable disable frontFace cullFace clear enableVertexAttribArray disableVertexAttribArray lineWidth clearStencil depthMask stencilMask stencilMaskSeparate checkFramebufferStatus generateMipmap activeTexture blendEquation'],
+ [1, 'clearDepth depthFunc enable disable frontFace cullFace clear enableVertexAttribArray disableVertexAttribArray lineWidth clearStencil depthMask stencilMask stencilMaskSeparate checkFramebufferStatus* generateMipmap activeTexture blendEquation'],
[2, 'pixelStorei blendFunc blendEquationSeparate'],
[3, 'texParameteri texParameterf drawArrays vertexAttrib2f'],
[4, 'viewport clearColor scissor vertexAttrib3f colorMask drawElements renderbufferStorage blendFuncSeparate'],
@@ -856,8 +856,14 @@ var LibraryGL = {
var num = data[0];
var names = data[1];
var args = range(num).map(function(i) { return 'x' + i }).join(', ');
- var stub = '(function(' + args + ') { ' + (num > 0 ? 'Module.ctx.NAME(' + args + ')' : '') + ' })';
+ var plainStub = '(function(' + args + ') { ' + (num > 0 ? 'Module.ctx.NAME(' + args + ')' : '') + ' })';
+ var returnStub = '(function(' + args + ') { ' + (num > 0 ? 'return Module.ctx.NAME(' + args + ')' : '') + ' })';
names.split(' ').forEach(function(name_) {
+ var stub = plainStub;
+ if (name_[name_.length-1] == '*') {
+ name_ = name_.substr(0, name_.length-1);
+ stub = returnStub;
+ }
var cName = 'gl' + name_[0].toUpperCase() + name_.substr(1);
assert(!(cName in LibraryGL), "Cannot reimplement the existing function " + cName);
LibraryGL[cName] = eval(stub.replace('NAME', name_));