rate up
1
rate down
Direct3D 11 Tutorial 14 (Simple Font)
Hi. Been working my way through your excellent Direct3D 11 Tutorials and got as far as the simple font tutorial before hitting a problem. I'm using Visual Studio 2015 on a Windows7 64bit machine, but VS is targeting 32 bit, so I'm pointing the linker at the D3D SDK X86 libraries. I've built all the previous tutorials from scratch and they've all worked fine. I was creating tutorial 14 from scratch as well, but when I hit this problem, I downloaded your files and created a fresh project using your files. Only changes were to the properties for include and lib directories. The code is crashing at line 359: hr = d3d101Device->OpenSharedResource(sharedHandle10, __uuidof(IDXGISurface1), (void**)(&sharedSurface10)); The exception is 'Exception thrown at 0x011685A2 in Font.exe: 0xC0000005: Access violation reading location 0x00000000.' and is caused by d3d101Device being null. I've traced this back to line 324: hr = D3D10CreateDevice1(Adapter, D3D10_DRIVER_TYPE_HARDWARE, NULL,D3D10_CREATE_DEVICE_DEBUG | D3D10_CREATE_DEVICE_BGRA_SUPPORT, D3D10_FEATURE_LEVEL_9_3, D3D10_1_SDK_VERSION, &d3d101Device ); After this call, hr is 'E_NOINTERFACE: No such interface supported' All the HRESULT's prior to this in InitializeDirect3d11App (ie the ones below, before the call to InitD2D_D3D101_DWrite) are returning S_OK, although I can't confirm that the data structures are valid, because VS doesn't have the symbols, IDXGIFactory1 *DXGIFactory; HRESULT hr = CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**)&DXGIFactory); // Use the first adapter IDXGIAdapter1 *Adapter; hr = DXGIFactory->EnumAdapters1(0, &Adapter); DXGIFactory->Release(); //Create our Direct3D 11 Device and SwapChain////////////////////////////////////////////////////////////////////////// hr = D3D11CreateDeviceAndSwapChain(Adapter, D3D_DRIVER_TYPE_UNKNOWN, NULL, D3D11_CREATE_DEVICE_DEBUG | D3D11_CREATE_DEVICE_BGRA_SUPPORT, NULL, NULL, D3D11_SDK_VERSION, &swapChainDesc, &SwapChain, &d3d11Device, NULL, &d3d11DevCon); I've included dxdiag output below. +[http://www.braynzarsoft.net/image/100212][input image title here] Any pointers you can give me would be greatly appreciated. This site is a great resource, many thanks.
Comments
could you try removing the D3D10_CREATE_DEVICE_DEBUG flag and let me know if that fixes the problem?
on Feb 13 `16
iedoc
Thanks. Tried that but it didn't work. I then tried varying the other parameters and ended up with the original combination, but with D3D10_FEATURE_LEVEL_9_1 instead of D3D10_FEATURE_LEVEL_9_3. This seems to work and looking at Microsoft's table of D3D feature levels, I can't see any immediate problems. Are there any?, and should I be looking for a driver update? Thanks again for your help.
on Feb 14 `16
davec
To tell you the truth, i don't know why changing the feature level of the device would have fixed your problem. what was the feature level your using to create your direct3d 11 device?
on Feb 14 `16
iedoc
Its NULL. hr = D3D11CreateDeviceAndSwapChain(Adapter, D3D_DRIVER_TYPE_UNKNOWN, NULL, D3D11_CREATE_DEVICE_DEBUG | D3D11_CREATE_DEVICE_BGRA_SUPPORT, NULL, NULL, D3D11_SDK_VERSION, &swapChainDesc, &SwapChain, &d3d11Device, NULL, &d3d11DevCon);
on Feb 15 `16
davec
Does other tutorials like 5 or 6 work for you?
on Feb 24 `16
IamU4
Yep, worked my way through all of them without any problems.
on Feb 25 `16
davec
I had a similar problem when building for 64-bit. This time it was fixed with D3D10_FEATURE_LEVEL_10_1. No problems when building for 32-bit.
on Aug 09 `16
awjapp12
Sign in to answer!