{"action":"reopened","issue":{"url":"https://api.github.com/repos/CreateJS/EaselJS/issues/559","labels_url":"https://api.github.com/repos/CreateJS/EaselJS/issues/559/labels{/name}","comments_url":"https://api.github.com/repos/CreateJS/EaselJS/issues/559/comments","events_url":"https://api.github.com/repos/CreateJS/EaselJS/issues/559/events","html_url":"https://github.com/CreateJS/EaselJS/issues/559","id":55742129,"number":559,"title":"WebGL does not wait for bitmap to load","user":{"login":"catalinberta","id":2418147,"avatar_url":"https://avatars.githubusercontent.com/u/2418147?v=3","gravatar_id":"","url":"https://api.github.com/users/catalinberta","html_url":"https://github.com/catalinberta","followers_url":"https://api.github.com/users/catalinberta/followers","following_url":"https://api.github.com/users/catalinberta/following{/other_user}","gists_url":"https://api.github.com/users/catalinberta/gists{/gist_id}","starred_url":"https://api.github.com/users/catalinberta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catalinberta/subscriptions","organizations_url":"https://api.github.com/users/catalinberta/orgs","repos_url":"https://api.github.com/users/catalinberta/repos","events_url":"https://api.github.com/users/catalinberta/events{/privacy}","received_events_url":"https://api.github.com/users/catalinberta/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CreateJS/EaselJS/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/CreateJS/EaselJS/labels/verified","name":"verified","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-28T11:03:11Z","updated_at":"2015-02-06T02:55:11Z","closed_at":null,"body":"When rendering an image that has been assigned as bitmap, WebGL needs some time before it recognizes the existence of the bitmap, take this example:\r\n\r\nvar stage = new createjs.SpriteStage('canvas_id', false, false);\r\nvar image = new createjs.Bitmap(\"img/sprite.png\");\r\nstage.addChild(image);\r\ncreatejs.Ticker.addEventListener(\"tick\", handleTick);\r\n\r\nHere, it won't load the image and it will give this error:\r\nWebGL: INVALID_VALUE: texImage2D: invalid image\r\n.WebGLRenderingContext]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete'\r\n\r\nHowever, if I assign the bitmap one second earlier width: \r\nvar image = new createjs.Bitmap(\"img/sprite.png\");\r\nand run the code again, it works just fine.\r\n\r\nAm I supposed to ensure that the image is loaded when running the code? Makes sense if I would have to do that, but why give such an error? It should just render the blank image (that didn't have time to load) instead or throwing errors that there is no image. \r\nAssigning the bitmap with a valid path should make it clear that there is an image there, loaded or unloaded.\r\n\r\nI already tried loading the image ahead with preloadjs, but it doesn't matter, it only works if I assign it as bitmap and wait for it to load as bitmap. Am I missing something? Is this normal behavior?"}}