You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed on the examples that it is common to use Scene::Create* functions to instantiate most of the rendering types, as opposed to directly calling the type's constructor. All Create* functions return shared pointers.
Does the scene keep shared ownership of everything which is created by Scene::Create*?
This seems to be true for some types but not others, for example:
auto light = scene->CreateDirectionalLight();
ASSERT_EQ(light.use_count(), 2u); // passes
auto ray = scene->CreateRayQuery();
ASSERT_EQ(ray.use_count(), 1u); // passes
I'd suggest we return `unique_ptr`s for those which the scene won't be keeping1. When calling `Visual::AddChild`, is the ownership shared with the visual? The same goes for other `Add` and `Set` functions which take `shared_ptr`s
What's the appropriate way to destroy something which was created with Scene::Create*? There are some Scene::Destroy* functions, but there isn't a 1-1 relation to the creates. How to destroy the missing ones?
Is there a situation when an object should / could be instantiated without the use of Scene::Create*?
The text was updated successfully, but these errors were encountered:
Original report (archived issue) by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).
I noticed on the examples that it is common to use
Scene::Create*
functions to instantiate most of the rendering types, as opposed to directly calling the type's constructor. AllCreate*
functions return shared pointers.Scene::Create*
?What's the appropriate way to destroy something which was created with
Scene::Create*
? There are someScene::Destroy*
functions, but there isn't a 1-1 relation to the creates. How to destroy the missing ones?Is there a situation when an object should / could be instantiated without the use of
Scene::Create*
?The text was updated successfully, but these errors were encountered: