By
RoverTurbo
How to display the screen resolution in d3d.
Code:
D3DVIEWPORT9 oViewport;
char cResolution[101];
HRESULT APIENTRY IDirect3DDevice9::BeginScene()
{
Device->GetViewport(&oViewport);
return Device->BeginScene();
}
HRESULT APIENTRY IDirect3DDevice9::EndScene()
{
sprintf(cResolution, "[ %d x %d ]", oViewport.Width, oViewport.Height);
return Device->EndScene();
}
Printing the cResolution variable will give you the resolution in the format of [ 800 x 600 ]
Credits: Directx documentation and Directx Community.