How do I port DX8's IDirect3DDevie8::CopyRects to DirectX9? I have found a function (stretchRect), but it doesn't seem to work...
//clear the window to blue
m_pD3DDevice->Clear (0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0);
//get back buffer
LPDIRECT3DSURFACE9 pBackBuffer;
m_pD3DDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer);
//start rendering
m_pD3DDevice->BeginScene();
//copy the surface to the screen
m_pD3DDevice->CopyRects (m_pD3DSurface, NULL, 0, pBackBuffer, NULL);
//end rendering
m_pD3DDevice->EndScene();
//present the rendered scene to the screen
m_pD3DDevice->Present(NULL, NULL, NULL, NULL);
heres the "replacement" code if it worked...
StretchRect(m_pD3DSurface, NULL, pBackBuffer, NULL, D3DTEXF_NONE);
ran the D3D debugger, here's the output:
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.