I'm working on a DX10 app with a DX9 fallback, and I have some questions.

Right now, I simply have it setup so if DX10 initialization fails, it will use DX9 instead. Of course, this causes problems. While it may work in Vista, all other versions of Windows don't even have the DX10 DLLs, so the app simply doesn't even run long enough to know if DX10 failed. How can I have the app load the DX10 DLLs if it can, but if it can't, load the DX9 ones instead.

Also, many functions in D3DX9 and D3DX10 go by the same name. Right now, whichever library I link first, it will call that version of it. For example, if I link d3dx9.lib and d3dx10.lib in that order, and call D3DXMatrixPerspectiveFovLH, it will be called using d3dx9_32.dll. But if I reverse the order of the libraries, it will be called using d3dx10.dll. How can I specify which version fo the APi should run these functions at runtime

Re: Game Technologies: Graphics Some Questions About Making a DX10 App with a DX9 Fallback


For the first problem, you can use LoadLibrary() to load DX10 DLL dynamically instead of linking statically.

For the second problem, I think the simplest way is to put DX9 and DX10 renderer implementation into two DLLs and each DLL link to its corresponding DX version.