title: how do I get DirectX 11 debug layer working
body: <p>I'm trying to get DirectX 11 debug layer working. So far I've enabled debugging on the device, and that's as far as I can get. I'm not getting any kind of debug output. All the guides I can find are basically just lumps of code without any real explanation of what's going on, so when it gets to applying what's in there to my specific problem it immediately breaks down and I get nowhere. I'm also not actually learning anything about how to use the debug layer, I'm not learning how to best utilise these technologies for my needs etc.</p>
  
  <p>Basically, can anyone provide me with a step by step of how to get the debug output working?</p>
  
  <p>This is what I've got so far:</p>
  
  <pre><code>DXGI_SWAP_CHAIN_DESC swapChainDesc;
  
  ZeroMemory(&amp;swapChainDesc, sizeof(DXGI_SWAP_CHAIN_DESC));
  
  swapChainDesc.BufferCount = 1;
  swapChainDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
  swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
  swapChainDesc.OutputWindow = hWnd;
  swapChainDesc.SampleDesc.Count = 4;
  swapChainDesc.Windowed = true;
  
  D3D_FEATURE_LEVEL featureLevels [] = { D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0 };
  
  UINT creationFlags = 0;
  
  #ifdef _DEBUG
  creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
  #endif
  
  D3D_FEATURE_LEVEL capabilities;
  D3D11CreateDeviceAndSwapChain(  NULL,
                                  D3D_DRIVER_TYPE_HARDWARE,
                                  NULL,
                                  creationFlags,
                                  featureLevels, //D3D_FEATURE_LEVEL *
                                  ARRAYSIZE(featureLevels), //number of feature levels
                                  D3D11_SDK_VERSION,
                                  &amp;swapChainDesc,
                                  &amp;m_swapChain,
                                  &amp;m_device,
                                  &amp;capabilities,
                                  &amp;m_devCon);
  </code></pre>
  
  <p>Thanks!</p>