Page 1 of 1

Create vs. Add

Posted: Mon Nov 24, 2014 6:26 pm
by ralian
From what I understand, if you create an object (i.e. a node) with a call to a function
that starts with add, the engine will drop it itself, but if you create an object (i.e. a
mesh) you need to call drop() yourself, correct?

Re: Create vs. Add

Posted: Mon Nov 24, 2014 10:53 pm
by ralian
If I might ask another question, what is the practical use of the scene node factory,
if all scene nodes can be created without it? Is it just an optional level of abstraction
between the creation of a node and the actual method used to create the node?

Re: Create vs. Add

Posted: Mon Nov 24, 2014 11:37 pm
by CuteAlien
First question - you got that correct.
Second questions - you need factories when you have created your own classes which are derived from Irrlicht classes and want those classes to work with the serialization mechanism of Irrlicht. For example when you create custom gui-elements and want to use the Irrlicht load function to load them from an xml. Then you add your own factory which can create your own gui-element.

Re: Create vs. Add

Posted: Mon Nov 24, 2014 11:42 pm
by ralian
Thanks, that sounds really convenient. :)