I need to do function like:
RGBTRIPLE GetPixelColor(int x, int y)
to get a color on a single pixel on directx 11 from the actual frame in my screen
For the moment I have this code:
//For each Call to Present() do the following:
//Get Device
ID3D11Device* device;
HRESULT gd = pSwapChain->GetDevice(__uuidof(ID3D11Device), (void**)&device);
assert(gd == S_OK);
//Get context
ID3D11DeviceContext* context;
device->GetImmediateContext(&context);
//get back buffer
ID3D11Texture2D* backbufferTex;
HRESULT gb = pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2d), (LPVOID*)&backbufferTex);
assert(gb == S_OK);
I'am not an expert on directx.
I ask how I can get the pixel color of coordinate x,y from buffer or context or other.
Can you help me please ?
Thanks !