detonator icon indicating copy to clipboard operation
detonator copied to clipboard

Handle and recover from WebGL context lost events

Open ensisoft opened this issue 3 years ago • 0 comments

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

ensisoft avatar Aug 18 '22 08:08 ensisoft