Skip to content

Conversation

@profelis
Copy link

@profelis profelis commented Feb 2, 2013

usage:

    function onDisposed()
    {
        engine.onReady = function () {
            engine.free(); // dispose debug line and point
            scene.free();  // dispose all buffers and shaders           
            tm.rebuildTextures(); // tm:TileManager
        }
        engine.init(); // reinit
    }

demo: https://dl.dropbox.com/u/1036911/h3d/contextLost/index.html

src: http://pastie.org/private/3ahbvmveacdpi6ctefakyw

@ncannasse
Copy link
Member

I made several changes recently in order to support lost of context:

  • you can setup a onContextLost callback on textures in order to upload them again
  • primitives should be reallocating themselves (use buffer == null || buffer.isDisposed() if you have custom ones)
  • you will get an engine.onContextLost callback that you can use to rebuild dynamic buffers
    Tell me if you want to suggest further changes

@ncannasse ncannasse closed this Mar 25, 2013
trethaller pushed a commit that referenced this pull request Feb 21, 2019
lbergman added a commit to lusius/heaps that referenced this pull request Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants