# DX11 application running on Windows XP using only DX9?

I'm developing an application that utilizes DX11. I know that DX11 is only available on Windows 7 (and Vista with SP). I wonder if there is some way to run the application on Windows XP and use only the old DX9? I need to prevent the loading of DX11 dlls when on Windows XP. How can this be done?

I've got an old renderer, that runs entirely on DX9 and a new renderer that uses DX11. My idea is to run the old renderer underr Windows XP and load only DX9 dlls, and to run the new renderer on Windows Vista / 7 and load DX11 stuff as well.

I've heard about a LoadLibrary() function that loads libraries at runtime. So far I have my Visual Studio project with all that DX11 .lib files in Additional Dependecies. How should I change this to load it completely at runtime? Do I need to define all symbols in DX11 .dlls manually?

• I've tried delayed load of DX11 dlls (by manually adding those dll filenames to Delayed Loaded DLLs in VS). But some dlls are versioned (D3DCompiler_43.dll) and I don't want to put the versioned name there, because if the version of DX11 changes, it would not work at all. – GPUquant Jan 21 '13 at 11:15
• And what happens if you specify D3DCompiler.dll instead of D3DCompiler_43.dll? – Laurent Couvidou Jan 21 '13 at 11:22
• Or if you don't put it at all? I suspect that this could be unnecessary, especially if you use D3DX and not the D3DCompiler directly. – Laurent Couvidou Jan 21 '13 at 11:39
• Effect framework seems to be using it directly. If I remove the D3DCompiler import, I get 2 unresolved external symbols... – GPUquant Jan 21 '13 at 11:48
• That's if you don't link against the .lib. You can leave that, this lib is common to all versions of DirectX. See there for details. And if your concerned about this version number in the DLL, then don't do delayed loading on it. – Laurent Couvidou Jan 21 '13 at 12:03

If you use the /delayload linker switch, it is safe to link your application against DX11 .libs and run it under Windows XP, as long as you do not call any DX11 function at runtime. This is equivalent to using LoadLibrary and GetProcAddress, except that it is far more convenient: no need to go for the old-fashioned way.
• but /delayload works just for mentioned dlls (/delayload:d3dx11.dll). I've several dlls that I want to load at startup and only those DX11 dlls to load on demand. So I add /delayload for every DX11 related dll. This seems to work, but I'm not sure if this is good solution, because I need to fill even the versioned dll names (like D3DCompiler_43.dll) – GPUquant Jan 21 '13 at 14:01
• Yes, but my point was, that I don't want to update this every time I change DX SDK version (d3dx11_43.dll will change to e.g. d3dx11_44.dll). In the lib is defined which dll to load. So I was looking for some automated solution. But I accept your solution. Thanks! – GPUquant Jan 22 '13 at 12:41