Original Post
Hi! I have been writing on a 3d rendering engine for a couple of months now. I have written it so it is easy to port to other systems by splitting the engine code from the platform dependent parts, like window and input, by putting all this kind of stuff in its own dynamic library. Though my idea of the engine was to make it as portable as possible, the engine is working close with the OpenGL API. The thing now is that I want it to run on an XBOX, so I have to do add Direct3D support also. My skills and knowledge about this API is equal to zero, so I will spend some time learning it. But before start adding this support to my engine I will check with you guys, who have written engines with support for multiple rendering systems, first. How should I do this? My idea is to write some kind of render system interface which each system (OpenGL, D3D) will implement. It will have functions like pushModelviewMatrix, enableDepthTest and stuff like that. What I want to know is if this is the right approach. Are the two APIs so totally different from each other so this approach won't work? Any ideas are welcome about how to prepare a 3D engine for multiple rendering systems! Thanks for your thoughts! /Klarre