title: DX11 swap chain only showing first frame. Flips between it and a black image
body: <p>When I run my 3d scene, it only renders the first frame and then flips between it and a black screen, causing lots of flicker. I think it's my swap chain that's not set up correctly, but I don't really know. </p>
  
  <p>Here's my code to set it up. It's pretty much copied from an Microsoft example. </p>
  
  <pre><code>DXGI_SWAP_CHAIN_DESC1 sd = {0};
  sd.Width = 0;                           
  sd.Height = 0;
  sd.Format = DXGI_FORMAT_R8G8B8A8_UNORM; 
  sd.Stereo = false; 
  sd.SampleDesc.Count = 1;                
  sd.SampleDesc.Quality = 0;
  sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
  sd.BufferCount = 2;                     
  sd.Scaling = DXGI_SCALING_NONE;
  sd.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
  sd.Flags = 0;
  
  CoreWindow^ window =  reinterpret_cast&lt;CoreWindow^&gt;(mSystem-&gt;GetIWindow());
  hr = pIDXGIFactory-&gt;CreateSwapChainForCoreWindow(mD3DDevice,  reinterpret_cast&lt;IUnknown*&gt;(window), &amp;sd, NULL, &amp;mSwapChain);
  EA_ASSERT(SUCCEEDED( hr ));
  </code></pre>
  
  <p>And the present code:</p>
  
  <pre><code>DXGI_PRESENT_PARAMETERS  presentParameters = {0};
  HRESULT hr = mSwapChain-&gt;Present1(0, 0, &amp;presentParameters);
  </code></pre>
  
  <p>Seems to me pretty straighforward, so I don't really get why it's not working.</p>
  
  <p>The scene is running all the time. The update function gets run every frame.</p>
  
  <p>Also, if I check the render in PIX, everything is fine. I get what I expect the render to be. It just doesn't appear on screen.</p>
  
  <p>Any ideas? Thanks!</p>