Orillusion / orillusion

Orillusion is a pure Web3D rendering engine which is fully developed based on the WebGPU standard.
https://www.orillusion.com
MIT License
4.47k stars 551 forks source link

[FR]: Engine3D destroy and release #125

Closed skytangleisky closed 7 months ago

skytangleisky commented 1 year ago

The Engine3D could be destroyed and re-create in one window context

  async function demo(){
    //init first Engine3D instance
    await Engine3D.init()
    // ...
    // Destroy it later
    await Engine3D.destroy()

    //init a second Engine3D instance
    await Engine3D.init()
    // could destroy it sometime
    await Engine3D.Destroy()
    // ...
  }
  demo()

The Engine3D memory and resources should be released/cleaned after destroy

lslzl3000 commented 1 year ago

Did you mean create multi Engine3D instance? Destroy an Engine3D instance and re-create a new one?

I have updated your issue description. Give me feedback if I missed anything.

skytangleisky commented 1 year ago

It's right that the Engine3D could be destroyed and re-create a new one in one window context.