the guy that asks weird things, here, again
I see that they use different executables, for a game that was created for both directx 9 and 10. It is possible to include “d3d9.h” and “d3d10.h” in a code file, then select direct3d 9 functions or direct3d 10 functions, depending on, for example, an argument that acts like a flag? I am not talking about drawing something using a direct3d 10 function using a direct3d 9 context and object.
What I want to do is create a function called init3D(UINT version); Depending on version, it will create a directx 9 or directx 10 object and device. I don’t know if that is possible or I must create two different executables (or 3 if I decide to use d3d8, too)
Thanks for your help and forgive my lack of understanding with some of the C++ techniques.
Yes it’s entirely possible.
The only issue is that the libraries for both must exist on the target machine. Because you’ve linked with d3d10 it must be installed on the machine for your .exe to even load even if you want to run in d3d9 mode, and that won’t be the case on xp machines.
To avoid this you’ll need to use dynamic linking to call any functions so that the libraries are only loaded at run time. Look up LoadLibrary and GetProcAddress. Luckily with direct3d the only global functions you’ll likely call are the “create” functions. D3DX will cause the same issues though