Closed inear closed 11 years ago
Hi!
When using multiple instances and updating textures the global active context can be wrong if loadContentsOf is fired before the global context has been updated. I solved it by adding a parameter to the texture object and assign it in the wrapper.
In the Texture constructor:
this.gl = gl;
and modify this method:
function wrapTexture(texture) {
return { _: texture, loadContentsOf: function(element) { //set correct global gl gl = this._.gl; this._.loadContentsOf(element); }, clear: function() { this._.clear(); }, width: function() { return this._.width; }, height: function() { return this._.height; }, destroy: function() { this._.destroy(); } };
}
/ Einar
Hi!
When using multiple instances and updating textures the global active context can be wrong if loadContentsOf is fired before the global context has been updated. I solved it by adding a parameter to the texture object and assign it in the wrapper.
In the Texture constructor:
this.gl = gl;
and modify this method:
function wrapTexture(texture) {
}
/ Einar