I don't think that a wrapper would be the best solution...
We changed the render engine from Ogre3D to Horde3D. I lack the d3d9 support though so I will start working on a D3D9 port but that will take a while because my daytime job and our hobby project is higher priority than d3d9 support. But this great engine and editor spared us a bunch of time so I would like to help the community.
I have some questions:
- How should be a new renderer integrated into the project?
-- separate renderer dll,
-- a horde3d dll with support of both (windows only)
-- separate horde3d_ogl and horde3d_d3d9.dll
-- any other possibillity?
The shader must be different (hlsl) :
-- the d3d9 renderer loads some other shader file (eg xxxxx.shader_d3d9.xml)
-- there would be some attribute in shader.xml <VertexShader profile="glsl"> or <VertexShader profile="vs_3_0"> that would describe the target of the shader.
-- I don't know glsl too well, but maybe some macros could hide the differences (so less work for implementing both, but this could create bugs hard to find)
Probably there will be some other problems: projection matrix differences, initialization differences, handling of d3d9's default pool resources lost, resource referencing differences (int handle vs pointer), there is no d3d9 texenv that stores sampler states (filtering, uv wrap, ...), no standard shadow map support. And probably much more but I haven't used OpenGL for years...