Hi everyone, today when I read the irr src code, I met the class map file. Suddenly, I realize that irr doesn't use STL map class but define its own map class.So, I confuse
Why? Is it necessary?
To be platform independent?Or, want to be faster?
Is there any other reason?
A hopeful beginner,
BluePanda
Why irr need to define its own map class?
Re: Why irr need to define its own map class?
Irrlicht does not use STL at all. The reason is mainly historical. Back when Irrlicht was written STL had more troubles. So most game engines used their own classes. It also has some advantages once in a while (it's easier to port to new platforms, there is more control and we can have freedom to add exactly those features we need, etc - if we had enough manpower it would probably be fine to continue with it). The core::map implementation actually got added later on and doesn't fit with other core classes so much (especially when it comes to memory management).
There are still some minor reasons to use own classes, but for Irrlicht 2.0 we will switch to STL.
As for speed ... in my experience STL is faster in pretty much every operation by now (was different years ago, but STL implementation are optimized a lot by now).
There are still some minor reasons to use own classes, but for Irrlicht 2.0 we will switch to STL.
As for speed ... in my experience STL is faster in pretty much every operation by now (was different years ago, but STL implementation are optimized a lot by now).
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Why irr need to define its own map class?
Thank you very much for your detail answer.CuteAlien wrote:Irrlicht does not use STL at all. The reason is mainly historical. Back when Irrlicht was written STL had more troubles. So most game engines used their own classes. It also has some advantages once in a while (it's easier to port to new platforms, there is more control and we can have freedom to add exactly those features we need, etc - if we had enough manpower it would probably be fine to continue with it). The core::map implementation actually got added later on and doesn't fit with other core classes so much (especially when it comes to memory management).
There are still some minor reasons to use own classes, but for Irrlicht 2.0 we will switch to STL.
As for speed ... in my experience STL is faster in pretty much every operation by now (was different years ago, but STL implementation are optimized a lot by now).
It's very helpful.