I am modifying the desktop duplication api sample kindly provided by Microsoft to capture the screen and send updates over the network to my application. I know how to actually send the data; my problem is getting the data from the ID3D11Texture2D object.
ID3D11Texture2D* m_AcquiredDesktopImage;
IDXGIResource* desktopResource = nullptr;
DXGI_OUTDUPL_FRAME_INFO FrameInfo;
// Get new frame
HRESULT hr = m_DeskDupl->AcquireNextFrame(500, &FrameInfo, &desktopResource);
// QI for IDXGIResource
hr = desktopResource->QueryInterface(__uuidof(ID3D11Texture2D), reinterpret_cast<void **>(&m_AcquiredDesktopImage));
At this point, I think the screen updates are in m_AcquiredDesktopImage
. I need to transmit this data over the wire (as efficiently as possible).
This answer seems to be on the right track, but I'm new to Windows programming, so I need some additional help.
This is the only solution I can imagine utilizing IDXGIObject::GetPrivateData