diff options
-rw-r--r-- | src/library_gl.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 93b50222..051e33a1 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -1241,7 +1241,7 @@ var LibraryGL = { totalEnabledClientAttributes: 0, enabledClientAttributes: [0, 0], - clientAttributes: [null, null], + clientAttributes: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}], clientActiveTexture: 0, byteSizeByType: { @@ -1255,9 +1255,12 @@ var LibraryGL = { }, setClientAttribute: function(name, size, type, stride, pointer) { - this.clientAttributes[GL.immediate.ATTRIBUTE_BY_NAME[name]] = { - size: size, type: type, stride: stride, pointer: pointer, name: name + size - }; + var attrib = this.clientAttributes[GL.immediate.ATTRIBUTE_BY_NAME[name]]; + attrib.size = size; + attrib.type = type; + attrib.stride = stride; + attrib.pointer = pointer; + attrib.name = name + size; }, // Renderers @@ -1432,9 +1435,12 @@ var LibraryGL = { }; }, + tempClientAttributes: [], prepareClientAttributes: function(count) { // Client attributes are to be used here, emulate that - var stride = 0, attributes = [], start; + var stride = 0, start; + var attributes = GL.immediate.tempClientAttributes; + attributes.length = 0; for (var i = 0; i < GL.immediate.NUM_ATTRIBUTES; i++) { if (GL.immediate.enabledClientAttributes[i]) attributes.push(GL.immediate.clientAttributes[i]); } |