R – Apps that support both DirectX 9 and 10


I have a noobish question for any graphics programmer.

I am confused how some games (like Crysis) can support both DirectX 9 (in XP) and 10 (in Vista)?

What I understand so far is that if you write a DX10 app, then it can only runs in Vista.

Maybe they have 2 code bases — one written in DX9 and another in DX10? But isn't that an overkill?

Best Solution

They have two rendering pipelines, one using DX9 calls and one using DX10 calls. The APIs are not compatible, though a majority of any game engine can be reused for either. If you want some Open Source examples of how different rendering pipelines are done, look at something like Ogre3d, which supports OpenGL, DX9, and (soon)DX10 rendering.

Related Question