title: IDirect3DDevice8::CopyRects in DirectX 9? C++
body: <p>How do I port DX8's IDirect3DDevie8::CopyRects to DirectX9? I have found a function (stretchRect), but it doesn't seem to work...</p>
  
  <pre><code>//clear the window to blue
  m_pD3DDevice-&gt;Clear (0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0);
  
  //get back buffer
  LPDIRECT3DSURFACE9 pBackBuffer;
  m_pD3DDevice-&gt;GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &amp;pBackBuffer);
  
  //start rendering
  m_pD3DDevice-&gt;BeginScene();
  //copy the surface to the screen
  m_pD3DDevice-&gt;CopyRects (m_pD3DSurface, NULL, 0, pBackBuffer, NULL); 
  //end rendering
  m_pD3DDevice-&gt;EndScene();
  
  //present the rendered scene to the screen
  m_pD3DDevice-&gt;Present(NULL, NULL, NULL, NULL);
  </code></pre>
  
  <p>heres the "replacement" code if it worked...</p>
  
  <pre><code>StretchRect(m_pD3DSurface, NULL, pBackBuffer, NULL, D3DTEXF_NONE);
  </code></pre>
  
  <p>ran the D3D debugger, here's the output:</p>
  
  <pre><code>Direct3D9: (INFO) :======================= Hal SWVP device selected
  
  Direct3D9: (INFO) :HalDevice Driver Style 9
  
  Direct3D9: :BackBufferCount not specified, considered default 1 
  Direct3D9: :DoneExclusiveMode
  Direct3D9: (INFO) :Failed to create driver indexbuffer
  Direct3D9: (INFO) :Using P4 PSGP
  
  Direct3D9: (ERROR) :This format is not supported for offscreen plain surfaces. CreateOffscreenPlainSurface fails.
  Game Library.exe has triggered a breakpoint
  Direct3D9: (ERROR) :Invalid source surface interface specified. StretchRect fails CreateOffscreenPlainSurface fails.
  </code></pre>