HRESULT CD3DRender::DrawBox(int X, int Y, int W, int H, D3DCOLOR ARGB)
{
D3DVERTEX Vertices[6];
Vertices[0] = { (float)X, (float)Y, 1.0f, 1.0f, ARGB };
Vertices[1] = { (float)X + W, (float)Y, 1.0f, 1.0f, ARGB };
Vertices[2] = { (float)X, (float)Y + H, 1.0f, 1.0f, ARGB };
Vertices[3] = { (float)X, (float)Y + H, 1.0f, 1.0f, ARGB };
Vertices[4] = { (float)X + W, (float)Y, 1.0f, 1.0f, ARGB };
Vertices[5] = { (float)X + W, (float)Y + H, 1.0f, 1.0f, ARGB };
DWORD FVF;
m_D3DDevice->GetFVF(&FVF);
m_D3DStateNorm->Capture();
m_D3DStateDraw->Apply();
m_D3DDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
m_D3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, 2, &Vertices, sizeof(D3DVERTEX));
m_D3DDevice->SetFVF(FVF);
m_D3DStateNorm->Apply();
return S_OK;
}