Skip to content

How come app.addScene(scene)/app.removeScene(scene) but no app.destroyScene(scene) #8

@BracerJack

Description

@BracerJack

Documentation says: It has scene.destroy(); but it's a little inconsistent not to have app.destroyScene(scene) or even better that and app.removeAndDestroyScene(scene).

Because if you don't do that, it leads to many internal questions/unknowns.
Do you have to remove the scene via app.removeScene and then scene.destroy later ? [This is syntaxtually not very beautiful.]

And what happen when you call scene.destroy without first calling app.removeScene ?
Does it holds a null bug waiting to happen then since it still technically holds a scene that is no longer there ?

All these could be eliminated if app.destroyScene(scene) and app.removeAndDestroyScene(scene) is implemented.

Please correct me if I am wrong thank you because I am learning and trying to make everything consistent in my mind :-)

Another case in point, you have:
scene.addResource(material, "Material");
scene.findResource("static_bounce", "Material");
scene.destroyResource("static_bounce", "Material"); //or material.destroy(); if you already have access to the material directly.

So for consistency sake, you have app.addScene, app.findScene but scene.destroy() but no app.destroyScene() is consistently wise a little strange I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions