Code:
void Crosshair(LPDIRECT3DDEVICE9 pDevice, D3DCOLOR color)
{
D3DVIEWPORT9 viewP;
pDevice->GetViewport( &viewP );
DWORD ScreenCenterX = viewP.Width / 2;
DWORD ScreenCenterY = viewP.Height / 2;
D3DRECT rect1 = {ScreenCenterX-5, ScreenCenterY, ScreenCenterX+5, ScreenCenterY+1};
D3DRECT rect2 = {ScreenCenterX, ScreenCenterY-5, ScreenCenterX+1, ScreenCenterY+5};
pDevice->Clear( 1, &rect1, D3DCLEAR_TARGET, color, 0, 0 );
pDevice->Clear( 1, &rect2, D3DCLEAR_TARGET, color, 0, 0 );
}
and in the endscene u need to call the function with the pDevice argument and a color
Code:
#define RED D3DCOLOR_ARGB(255, 255, 000, 000) // Define the color RED in Direct
Crosshair(pDevice, RED); // Call the CrossHair with the color RED