MSDN Page for ReportLiveObjects
I am unsure how to call the ReportLiveObjects method as the classes I am attempting to declare are abstract, or in the case of IDXGIDebug "undeclared" (I think I'm missing a header file?).
Here are the snippets.
ID3D11Debug *debugDev = new ID3D11Debug();
debugDev->ReportLiveDeviceObjects( D3D11_RLDO_DETAIL );
The above code tells me the class is abstract so I cannot create an object.
IDXGIDebug debugDev = new IDXGIDebug();
The above code tells me that IDXGIDebug is undeclared.
The header file "DXGI" has been included. Debug layer is on.
Any help would be appreciated.
Of course you can't create ID3D11Debug interface directly.
The first step is to create your ID3D11Device with D3D11_CREATE_DEVICE_DEBUG flag, like this:
creationFlags = 0;
#ifdef _DEBUG
creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
#endif
D3D11CreateDevice(...);
Then you have to query ID3D11Debug interface from your device, like this:
m_d3dDevice->QueryInterface(__uuidof(ID3D11Debug), reinterpret_cast<void**>(&m_d3dDebug));
Two useful links about the D3D debug layer:
http://msdn.microsoft.com/en-US/library/windows/desktop/jj200584(v=vs.85).aspx http://blogs.msdn.com/b/chuckw/archive/2012/11/30/direct3d-sdk-debug-layer-tricks.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With