rossi46 Posted November 7, 2017 Share Posted November 7, 2017 I create pixi game. when i change tab it normal. but when i minimize browser. it has "webgl has hit a snag". and my canvas fail. console log has: "webgl: context_lost_webgl: losecontext: context lost". How to fixed it. Thanks ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 7, 2017 Share Posted November 7, 2017 When you minimize the browser, RAF stops working, but setInterval still is. When you change to normal, the "delta" in RAF becomes big (seconds), so if you depend on delta frame and spawn particles, you'll spawn too many objects. That's my guess. Check how many runtime generated textures are in your projects and estimate how much memory do you use, check if you forget to destroy() unused generated textures. I really don't know what to advice, the number of facts you've provided is too small. Quote Link to comment Share on other sites More sharing options...
rossi46 Posted November 7, 2017 Author Share Posted November 7, 2017 35 minutes ago, ivan.popelyshev said: When you minimize the browser, RAF stops working, but setInterval still is. When you change to normal, the "delta" in RAF becomes big (seconds), so if you depend on delta frame and spawn particles, you'll spawn too many objects. That's my guess. Check how many runtime generated textures are in your projects and estimate how much memory do you use, check if you forget to destroy() unused generated textures. I really don't know what to advice, the number of facts you've provided is too small. here is memory of my game. I do not use particles. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 7, 2017 Share Posted November 7, 2017 It wont show you total video memory used. Try to switch off several features of your game to understand what exactly is hitting the snag Quote Link to comment Share on other sites More sharing options...
rossi46 Posted November 7, 2017 Author Share Posted November 7, 2017 55 minutes ago, ivan.popelyshev said: It wont show you total video memory used. Try to switch off several features of your game to understand what exactly is hitting the snag I deleted all game and i just have create canvas it is hitting the snag. I load one image size 1110x624 and just create game loader.add("iconsAnimation", ConfigSt.BASE_URL + "assets/images/anim.png"); this.game = new PIXI.Application(1140, 500, { antialias: false, transparent: true, resolution: 1 }); //this.game.ticker.speed = 2; //this.game.ticker.minFPS = 60; $("#gamePlay").append(this.game.view); this.mainContainer = new Container(); this.containerColumn1 = new Container(); this.containerColumn2 = new Container(); this.containerColumn3 = new Container(); this.containerColumn4 = new Container(); this.containerColumn5 = new Container(); this.effectContainer = new Container(); this.iconsContainer = new Container(); this.mainContainer.addChild(this.containerColumn1, this.containerColumn2, this.containerColumn3, this.containerColumn4, this.containerColumn5, this.iconsContainer); this.game.stage.addChild(this.mainContainer, this.effectContainer); Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 7, 2017 Share Posted November 7, 2017 Then there's something wrong with your videodrivers. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.