building-the-game
building-the-game copied to clipboard
code sequence wrong?
The bellow in gl-util.js file code maybe wrong.
loadedCallback(self);
if(self.callback) { self.callback(self.texture); }
right one should be :
if(self.callback) { self.callback(self.texture); }
loadedCallback(self);
The reason for this is that loadTexture in the following code will change the callback and texture of itself.
function releaseTextureImageLoader(til) {
var req;
if(pendingTextureRequests.length) {
req = pendingTextureRequests.shift();
til.loadTexture(req.gl, req.src, req.texture, req.callback);
} else {
textureImageCache[cacheTop++] = til;
}
}