void DrawCircle(float mx, float my, float r, D3DCOLOR colour)
{
static const int CIRCLE_RESOLUTION = 10;
D3DVertex verts[CIRCLE_RESOLUTION];
for (int i = 0; i < CIRCLE_RESOLUTION; ++i)
{
verts[i].X = mx + r * cos(D3DX_PI * (i / (CIRCLE_RESOLUTION / 2.0f)));
verts[i].Y = my + r * sin(D3DX_PI * (i / (CIRCLE_RESOLUTION / 2.0f)));
verts[i].Z = 0.0f;
verts[i].RHW = 1.0f;
verts[i].Colour = colour;
verts[i].U = 1.0f;
verts[i].V = 1.0f;
}
d3ddevice->SetFVF(VERTEX_FVF);
d3ddevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, CIRCLE_RESOLUTION - 2, verts, sizeof(D3DVertex));
}