0
votes

First off, according to dxdiag, I have DirectX version 11. However, I'm going through a tutorial (rastertek.com) and while initializing my directx device (specifically the D3D11CreateDeviceAndSwapChain function), it returns an error (therefore the program gets stopped). On the above site, there are both tutorials for D11 and D10, and, as previously stated, the D11 version won't work, however the D10 version does work. So I don't get why even though I have DX version 11, the program fails.

Here's where the program returns an error:

result = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, &featureLevel, 1, 
                       D3D11_SDK_VERSION, &swapChainDesc, &m_swapChain, &m_device, NULL, &m_deviceContext);

You can see where all of these variables come from at http://www.rastertek.com/dx11tut03.html, it's a little bit more than 1/3 down the page.

I have seen other problems with this function in other forums (and what they do doesn't help me), as well as msdn which says if the first parameter is non-null, set the second parameter to D3D_DRIVER_TYPE_UNKNOWN, which still doesn't make a difference.

Any enlightenment on this problem is greatly appreciated! Thanks!!

1
As far as I know dxdiag only shows which version of DirectX is installed on your system, but that does not mean that your hardware supports that version. Apparently your graphics card only supports up to DirectX 10, which is why the function failsUnholySheep
That's a bummer (and it's also true), I'll make this best answer if you post it @UnholySheepuser2948879
This utility should be helpful to determine the capabilities of GPU that you are using....Recker

1 Answers

0
votes

As requested:
dxdiag only shows which version of DirectX is installed on the system, but that does not mean that the hardware really does support it.
Therefore it is possible that dxdiag shows DirectX 11 while the hardware only supports up to DirectX 10, which will cause DirectX11 only code to fail.