Skip to main content
GameDev.net gamedev.net
🔒 Locked

Rendering question

Started by jcpayne93 Sep 8, 2012 at 9:14 AM 3 replies 1.3k views
Original Post
jcpayne93
jcpayne93
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.
Jason Z
Jason Z
You more or less already answered the question - the engines just use an abstraction layer to make the actual rendering calls behind an engine specific API. This lets the actual core code and game code use whichever rendering system is selected at the time, without even knowing which rendering API is being used.

I'm sure each engine uses different techniques to implement this strategy, but that is the basic idea.
Jason Zink :: DirectX MVP   Direct3D 11 engine on CodePlex: Hieroglyph 3 Direct3D Books: 
jcpayne93
jcpayne93
Ahh I see, that was something I was wondering about and not quite too sure, but it seems like it would be inefficient because it has a lot of overhead sitting around to make calls to the different APIs.

But I suppose its a necessary sacrifice to extend portability to different platforms
MJP
MJP
There doesn't have to be any overhead at runtime. You already need to compile different versions of your executable for each platform you target, so when you compile them you can just have the engine use the appropriate rendering code path for that platform and ignore everything else.
jcpayne93
jcpayne93
Alright I get it now, and thanks for taking the time to respond guys.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.