I'm pretty new to direct x, if you've seen my other posts, you probably know that. I'm trying to copy the middle section of the back buffer to a different surface and then copy that back to the top half of the back buffer. My plan later on is to do this twice, copying the back buffer to 2 different surfaces, then modifying those surfaces, and finally copying them back to the back buffer in a sort of splitscreen fashion (so that one surface copies to the top half of the back buffer, and the other surface copies to the bottom half of the back buffer).
Here's my code, which seems pretty sound to me:
//rendering stuff
m_lpDX->m_lpDevice->EndScene();
IDirect3DSurface9 * frame1 = NULL;
IDirect3DSurface9 * pBackBuffer = NULL;
RECT r1;
SetRect(&r1, GetHeight()/4, 0, GetWidth(), ((GetHeight()*3)/4)-1);
m_lpDX->m_lpDevice->GetBackBuffer( 0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer );
m_lpDX->m_lpDevice->CreateOffscreenPlainSurface(GetWidth(),GetHeight()/2,D3DFMT_X8R8G8B8,D3DPOOL_DEFAULT,&frame1,NULL);// - CAT
D3DLOCKED_RECT frame1Lock;
D3DLOCKED_RECT pBackBufferLock;
frame1->LockRect(&frame1Lock,NULL,NULL);
pBackBuffer->LockRect(&pBackBufferLock,NULL,NULL);
m_lpDX->m_lpDevice->UpdateSurface(pBackBuffer,&r1,frame1,NULL);
r1.top = 0;
r1.left = 0;
m_lpDX->m_lpDevice->UpdateSurface(frame1,&r1,pBackBuffer,NULL);
frame1->UnlockRect();
pBackBuffer->UnlockRect();
frame1->Release();
pBackBuffer->Release();
Trouble is, nothing changes. The regular back buffer still shows. Does anyone have any trouble shooting ideas?