diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/library_gl.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 766c0557..35d73684 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -1381,6 +1381,13 @@ var LibraryGL = { Module.ctx.bindTexture(Module.ctx.TEXTURE_2D, texture); Module.ctx.uniform1i(this.textureLocation, 0); } + }, + + cleanup: function() { + Module.ctx.disableVertexAttribArray(this.positionLocation); + if (this.hasTexture) { + Module.ctx.disableVertexAttribArray(this.texCoordLocation); + } } }; ret.init(); @@ -1532,6 +1539,8 @@ var LibraryGL = { Module.ctx.drawArrays(GL.immediate.mode, startIndex, numVertexes); } + renderer.cleanup(); + if (!GL.currArrayBuffer) { Module.ctx.bindBuffer(Module.ctx.ARRAY_BUFFER, null); } |