4

I'm working through DirectX 9 with a book, the examples #include d3dx9tex.h intellisense is indicating this file does not exist, as a result hResult = D3DXGetImageInfoFromFile(filename.c_str(), &imageInfo); is also showing errors. I have DirectX 12 installed. Can anyone help?

SurvivalMachine
  • 7,158
  • 13
  • 53
  • 74

2 Answers2

2

All Direct3D 9 programming books and tutorials assume you are using the DirectX SDK which is where you'd find the D3DX support library. The DirectX SDK itself is legacy as is Direct3D 9. D3DX9, D3DX10, and D3DX11 are deprecated. See Where is the DirectX SDK?.

If you have Windows 10 (which is required for DirectX 12) or Windows 8.x or Windows 7, then my suggestion is to learn Direct3D 11. Direct3D 9 is only useful today if you are trying to target Windows XP systems, and there are many caveats to trying to develop with Direct3D 9 on Windows 8.x or Windows 10. Direct3D 12 is an expert graphics API that assumes you are already fully capable of writing a Direct3D 11 application. A good place to start are the tutorials for DirectX Tool Kit. You don't need the legacy DirectX SDK at all to build Direct3D 11 applications as all the headers, libraries, and the HLSL compiler are included with VS 2012, VS 2013, and VS 2015.

See also Living without D3DX, DirectX SDK Samples Catalog, DirectX SDK Tools Catalog, DirectX SDKs of a certain age, The Zombie DirectX SDK

UPDATE: There is a DirectX Tool Kit for DX12 available.

I also recently added a DDSTextureLoader and WICTextureLoader implementation for Direct3D 9 to the DirectXTex project. See this blog post.

Chuck Walbourn
  • 28,931
  • 1
  • 45
  • 72
0

d3d9helper.h (which is included in all Windows SDK) Now strictly speaking, you should be using a more Modern DirectX unless the intention here is to support older versions of Windows.

Still keep in mind that Windows 7 / 8 / 10 support both DirectX 11 and 12, and if you're exclusively releasing something for Windows 10, then just use DirectX 12... it can be a bit more daunting to initially learn, it's much more powerful (from a Developer Standpoint) in terms of Control you have over the Hardware and Pipeline.

  • I wouldn't recommend using DirectX 12 like that. If you don't need any advanced features, you are probably better with DirectX 11, just because it's simpler. – bestdark Feb 05 '21 at 17:00