diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-02-27 21:43:09 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-02-27 21:43:09 -0500 |
commit | a748f17dfd73123366294645c37362618d02ab10 (patch) | |
tree | d7a1babc1d2d0b8a56b1a23f382f4d0af496139c /src/library_gl.js | |
parent | 25c344becdbb1f96a514479452e0b29ddf9f7ce5 (diff) |
fix glIs*
Diffstat (limited to 'src/library_gl.js')
-rw-r--r-- | src/library_gl.js | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 2e5fe918..d165ede2 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -535,11 +535,9 @@ var LibraryGL = { }, glIsBuffer: function(buffer) { - var fb = GL.buffers[buffer]; - if (typeof(fb) == 'undefined') { - return 0; - } - return Module.ctx.isBuffer(fb); + var b = GL.buffers[buffer]; + if (!b) return 0; + return Module.ctx.isBuffer(b); }, glGenRenderbuffers__sig: 'vii', @@ -570,11 +568,9 @@ var LibraryGL = { }, glIsRenderbuffer: function(renderbuffer) { - var fb = GL.renderbuffers[renderbuffer]; - if (typeof(fb) == 'undefined') { - return 0; - } - return Module.ctx.isRenderbuffer(fb); + var rb = GL.renderbuffers[renderbuffer]; + if (!rb) return 0; + return Module.ctx.isRenderbuffer(rb); }, glGetUniformfv: function(program, location, params) { @@ -940,11 +936,9 @@ var LibraryGL = { }, glIsShader: function(shader) { - var fb = GL.shaders[shader]; - if (typeof(fb) == 'undefined') { - return 0; - } - return Module.ctx.isShader(fb); + var s = GL.shaders[shader]; + if (!s) return 0; + return Module.ctx.isShader(s); }, glCreateProgram__sig: 'i', @@ -1057,9 +1051,7 @@ var LibraryGL = { glIsFramebuffer__sig: 'ii', glIsFramebuffer: function(framebuffer) { var fb = GL.framebuffers[framebuffer]; - if (typeof(fb) == 'undefined') { - return 0; - } + if (!fb) return 0; return Module.ctx.isFramebuffer(fb); }, |