how to translate OpenGL to Direct3D
Excuse me ^^
Is there any tool that can automatically translate an OpenGL application
program into a Direct3D application program?
If there is none, does anyone list the corresponding functions between the
OpenGL functions and Direct3D functions so that I can use them to manually
translate an OpenGL application program into a Direct3D application program?
Thank you very much for your help.
While certainly possible, such a tool does not exist to the best of my knowledge..
Something similar was Scitech GLDirect ( a few years ago ) which was an opengl driver that was implemented atop of Direct3D so any OpenGL Program could run using D3d Drivers. But a static source code translation program does not exist.
GL and D3D use different methodlogies. While OpenGL is strictly procedural, D3D is COM based and thus functionality is encapsulated into interface classes. A straight function to function mapping is not possible this way, your best bet would be to write a wrapper that maybe exposes all GL functions with a different prefix like dglBegin or something and internally then calls on D3D Interfaces.
You should check out the D3d Reference documentation in its SDK, downloadable from Microsoft, it contains a complete reference on all interfaces and methods.
Something similar was Scitech GLDirect ( a few years ago ) which was an opengl driver that was implemented atop of Direct3D so any OpenGL Program could run using D3d Drivers. But a static source code translation program does not exist.
GL and D3D use different methodlogies. While OpenGL is strictly procedural, D3D is COM based and thus functionality is encapsulated into interface classes. A straight function to function mapping is not possible this way, your best bet would be to write a wrapper that maybe exposes all GL functions with a different prefix like dglBegin or something and internally then calls on D3D Interfaces.
You should check out the D3d Reference documentation in its SDK, downloadable from Microsoft, it contains a complete reference on all interfaces and methods.
The common and simplest solution is to declare your own virtual renderer then implement it in the two flavours (DX and GL).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement