-1
\$\begingroup\$

I am facing problem with my directtx 9 code?

\$\endgroup\$
3
  • \$\begingroup\$ Why not go ahead and try it? From my experience, there is a collision with Windows SDK, but you would have it with dx11 as well. \$\endgroup\$
    – wondra
    Feb 1, 2015 at 13:45
  • \$\begingroup\$ This should be rephrased a bit to "How can I..." \$\endgroup\$ Feb 1, 2015 at 14:50
  • \$\begingroup\$ Do I have to install windows SDK? wondra? \$\endgroup\$
    – Akeedify
    Feb 1, 2015 at 16:46

1 Answer 1

1
\$\begingroup\$

VS 2013 Express for Desktop, VS 2013 Pro+, or VS 2013 Community include the full Windows 8.1 SDK. This includes the system headers for Direct3D 9 (d3d9*.h) as has been the case since Windows SDK 6.0.

The problem is that your Direct3D 9 code likely makes use of the deprecated D3DX9 library such as D3DXmath, FX9, the original HLSL compiler, etc. You can switch to use the D3DCompile APIs and FXC.EXE which are in the Windows 8.1 SDK which supports shader model 2.x and shader model 3.0 profiles. You can use DirectXMath in the Windows 8.1 SDK. However, FX9 and other parts of D3DX9 are only available in the legacy DirectX SDK. In order to use the DirectX SDK with VS 2013, you have to reverse the long-standing path recommendations in your VC++ Directory settings to put the DirectX SDK include/lib paths last rather than first as they are now outdated compared to the Windows SDK. See MSDN for details and some other notes.

$(IncludePath);$(DXSDK_DIR)Include
$(LibraryPath);$(DXSDK_DIR)Lib\x86 or x64 

Furthermore, there is no support for the Direct3D 9 debug runtime in the Windows 8.1 SDK. You can install the legacy DirectX SDK to get it for Windows XP SP2 - Windows 7, but you can't get a version of it for Windows 8.x or Windows 10.

There's no support for Direct3D 9 in the VS 2013 Graphics Diagnostics. Legacy PIX for Windows in the DirectX SDK should work for Direct3D 9 apps given these caveats.

Finally, this all assumes you are using the "v120" Platform Toolset. If you use the "v120_xp" Platform Toolset you are actually using the Windows 7.0A SDK rather than the Windows 8.1 SDK. This is more old school and you have to use the legacy DirectX SDK as you've done in the past. See this post for the implications of doing that.

$(DXSDK_DIR)Include;$(IncludePath)
$(DXSDK_DIR)Lib\x86 or x64;$(LibraryPath)

See A Brief History of Windows SDKs and DirectX SDKs of a certain age.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .