detonator
detonator copied to clipboard
Handle and recover from WebGL context lost events
In the web environment it's possible for the game to suffer an "context lost" event. This might happen when for example when the browser decides to clean up the underlying graphics context when the user tabs out of the current browser tab that is running the game.
A recovery would require:
- realize that the rendering context was lost
- recreate the rendering context
- recreate the graphics device and context state, reupload all the required data, vertex buffers, textures, programs