aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjulien.hamaide <julien.hamaide@fishingcactus.com>2012-02-09 03:01:27 +0100
committerjulien.hamaide <julien.hamaide@fishingcactus.com>2012-02-09 03:01:27 +0100
commit05ee87ee865ece5edef2e535addd909baa74017e (patch)
treefe8dca3132c95c886784000d4521f068fc36f0f8 /src
parent601ea58606e7767b1afc3346e0f3e35847e5acc8 (diff)
Explicit handling of id 0 in hastable
Diffstat (limited to 'src')
-rw-r--r--src/library_gl.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 67c3dce4..389d8d5b 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -10,7 +10,7 @@ var LibraryGL = {
}
if (!(name in this._hashtables)) {
this._hashtables[name] = {
- table: {0:null},
+ table: {},
counter: 0,
add: function(obj) {
var id = this.counter++;
@@ -18,6 +18,8 @@ var LibraryGL = {
return id;
},
get: function(id) {
+
+ if( id == 0 ) return null;
#if ASSERTIONS
assert(id < this.counter, "Invalid id " + id + " for the hashtable " + name);
#endif
@@ -346,7 +348,7 @@ var LibraryGL = {
glBindFramebuffer_deps: ['$GL'],
glBindFramebuffer: function(target, framebuffer) {
- Module.ctx.bindFramebuffer(target, GL.hashtable("framebuffer").get(framebuffer));
+ Module.ctx.bindFramebuffer(target, GL.hashtable("framebuffer").get(framebuffer));
},
glGenFramebuffers_deps: ['$GL'],