I am trying to read the backbuffer data for desktop screen capture using GetBackBuffer and display it on a window.I have intialised the directx and registered the window class.
My problem is in displaying the data it reads.I get a black window with the code snippet i am using now.Could anyone help me in working this out.
IDirect3DSurface9 *offscreenSurface = 0;
d3ddev->CreateOffscreenPlainSurface(1366, 768, D3DFMT_A8B8G8R8, D3DPOOL_DEFAULT, &offscreenSurface, NULL);
HRESULT hr1 = d3ddev->CreateRenderTarget(1366, 768, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, TRUE, &offscreenSurface, NULL);
HRESULT hr = d3ddev->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &offscreenSurface);