const float PI = 3.14159265f;const float DEGTORAD = PI / 180.0f; // DEGTORAD * degreesbool SetCustomVertex(CUSTOMVERTEX *pVertex, float x, float y, float z, float rhw, D3DCOLOR Color, float tu, float tv){ if (!pVertex) return false; pVertex->x = x; pVertex->y = y; pVertex->z = z; pVertex->rhw = rhw; pVertex->Color = Color; pVertex->tu = tu; pVertex->tv = tv; return true;}void Draw2DCircle(UINT uX, UINT uY, D3DCOLOR Color, float fRadius){ CUSTOMVERTEX Vertex[360]; for (int i = 0; i < 360; i++) { float f = DEGTORAD * i; SetCustomVertex(&Vertex, (float)(uX + cos(f) * fRadius), (float)(uY + sin(f) * fRadius), 0.5f, 1.0f, Color, 0.0f, 0.0f); } g_pDevice->SetFVF(D3DFVF_CUSTOMVERTEX); g_pDevice->SetTexture(0, NULL); g_pDevice->DrawPrimitiveUP(D3DPT_POINTLIST, 360, &Vertex[0], sizeof(Vertex[0]));}
The problem is:
[image]http://img228.imageshack.us/img228/7972/immaginefpk.png[/image]
There are some points that aren't filled