Why irr need to define its own map class?

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.

Why irr need to define its own map class?

Postby BluePanda » Tue Aug 01, 2017 1:17 pm

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
BluePanda
 
Posts: 4
Joined: Tue Aug 01, 2017 1:11 pm

Re: Why irr need to define its own map class?

Postby CuteAlien » Tue Aug 01, 2017 1:32 pm

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).
IRC: #irrlicht on irc.freenode.net
Code snippets, patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Free racer created with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
User avatar
CuteAlien
Admin
 
Posts: 8363
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: Why irr need to define its own map class?

Postby BluePanda » Tue Aug 01, 2017 2:01 pm

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).


Thank you very much for your detail answer.
It's very helpful.
BluePanda
 
Posts: 4
Joined: Tue Aug 01, 2017 1:11 pm


Return to Beginners Help

Who is online

Users browsing this forum: No registered users and 1 guest