Create vs. Add

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
ralian
Posts: 28
Joined: Tue Nov 11, 2014 1:00 am

Create vs. Add

Post 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?
ralian
Posts: 28
Joined: Tue Nov 11, 2014 1:00 am

Re: Create vs. Add

Post 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?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Create vs. Add

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
ralian
Posts: 28
Joined: Tue Nov 11, 2014 1:00 am

Re: Create vs. Add

Post by ralian »

Thanks, that sounds really convenient. :)
Post Reply