flambe
flambe copied to clipboard
WARN flambe: Failed to create texture. Is the GPU context unavailable?
when my assets folder is empty,it's will be flambe get error
here is test code.
private static function onSuccess(pack:AssetPack) {
var texture:Texture= System.createTexture(100, 100);
texture.graphics.fillRect(0xff00ff, 0, 0, 100, 100);
}
Yeah, unfortunately creating a Stage3D context is asynchronous. So it's possible for it not to be ready yet by the time you call createTexture(), which is especially likely with an empty asset pack that loads immediately.
You can try watching System.hasGPU, and wait for it to become true. Or wait a frame.
Maybe we want System.init() to take a callback that gets called when everything's fully initialized. That's a little annoying but it may be the best solution.
I'm getting this issue and the asset folder isn't empty. The context also never becomes available even as I check it every 100 ms with a haxe timer. The target platform is flash, though, and this error just materialized without changing any of the code after picking it up several months and several flambe updates later. Hmm. It seems to happen mainly in Firefox, not Chrome, and in flash, not html5.