First of all I had no Idea where to put this but I put it into DirectX because it was somewhat related to the topic.
As to the actual question... I was wondering how exactly are modern game engines such as Crytech, Unity, etc.... able to fully develop their game then just port it to Windows, Mac, Xbox 360, PS3, and so on. To be somewhat more specific how are they able to use DirectX, OpenGl, and then use it for the console that's opposite of what it's for.
Do they use both languages and then just write an api layer over them so that it makes a call to use whichever language is needed for the port?
That is in a nutshell my question and I hope you were able to understand what I was asking.