phamedev Posted October 20, 2017 Share Posted October 20, 2017 When I change tab in chrome browser on PC and visit again after like 30 minutes the game screen is blank with this warning message: WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost On one of my android tabs that happens when I press home button and open android browser again. I tried the search function of this forum but could not find anything relevant. What is happening and how to prevent it? If anyone knows how to handle the context_lost situation or redirect me to the helpful resource. Thanks Link to comment Share on other sites More sharing options...
samme Posted October 21, 2017 Share Posted October 21, 2017 You can't prevent it. The device can discard the context when it thinks it doesn't need it anymore or it needs to use the GPU for something else. Link to comment Share on other sites More sharing options...
Aerion Posted October 22, 2017 Share Posted October 22, 2017 Oh REALLY? https://www.khronos.org/webgl/wiki/HandlingContextLost Link to comment Share on other sites More sharing options...
samme Posted October 22, 2017 Share Posted October 22, 2017 You can't prevent it, you can just ask for it back once it's lost (which Phaser already does). I think all you can do is destroy and recreate the game. Link to comment Share on other sites More sharing options...
Recommended Posts