Hallo, ich bins mal wieder =D
Ich wollte ein D3D Crosshair machen, das funzt auch bis auf die DrawCircle und die DrawLine Funktion :/
Bei denen crasht das game immer :(
Hier die Funktionen:
Ich hab schon ausgetestet, nur einen kreis und nur einen strich zeichnen zu lassen, aber bei beidem stürzt das game ab. Ich schätz mal in beiden Funktionen ist der selbe Fehler vorhanden :S
Ich wollte ein D3D Crosshair machen, das funzt auch bis auf die DrawCircle und die DrawLine Funktion :/
Bei denen crasht das game immer :(
Hier die Funktionen:
Code:
void DrawCircle(int X, int Y, int radius, int numSides, DWORD Color)
{
D3DXVECTOR2 Line[128];
float Step = PI * 2.0 / numSides;
int Count = 0;
for (float a=0; a < PI*2.0; a += Step)
{
float X1 = radius * cos(a) + X;
float Y1 = radius * sin(a) + Y;
float X2 = radius * cos(a+Step) + X;
float Y2 = radius * sin(a+Step) + Y;
Line[Count].x = X1;
Line[Count].y = Y1;
Line[Count+1].x = X2;
Line[Count+1].y = Y2;
Count += 2;
}
pLine->Begin();
pLine->Draw(Line,Count,Color);
pLine->End();
}
void DrawLine(float x, float y, float x2, float y2, float width, DWORD color)
{
D3DXVECTOR2 vLine[2];
pLine->SetWidth( width );
pLine->SetAntialias( false );
pLine->SetGLLines( true );
vLine[0].x = x;
vLine[0].y = y;
vLine[1].x = x2;
vLine[1].y = y2;
pLine->Begin();
pLine->Draw( vLine, 2, color );
pLine->End();
}