@@ -398,7 +398,38 @@ void DrawCircleLines(int centerX, int centerY, float radius, Color color)
398398 rlVertex2f (centerX + sinf (DEG2RAD * i )* radius , centerY + cosf (DEG2RAD * i )* radius );
399399 rlVertex2f (centerX + sinf (DEG2RAD * (i + 10 ))* radius , centerY + cosf (DEG2RAD * (i + 10 ))* radius );
400400 }
401- rlEnd ();
401+ rlEnd ();
402+ }
403+
404+ // Draw ellipse
405+ void DrawEllipse (int centerX , int centerY , float radiusH , float radiusV , Color color )
406+ {
407+ if (rlCheckBufferLimit (3 * 36 )) rlglDraw ();
408+
409+ rlBegin (RL_TRIANGLES );
410+ for (int i = 0 ; i < 360 ; i += 10 )
411+ {
412+ rlColor4ub (color .r , color .g , color .b , color .a );
413+ rlVertex2f (centerX , centerY );
414+ rlVertex2f (centerX + sinf (DEG2RAD * i )* radiusH , centerY + cosf (DEG2RAD * i )* radiusV );
415+ rlVertex2f (centerX + sinf (DEG2RAD * (i + 10 ))* radiusH , centerY + cosf (DEG2RAD * (i + 10 ))* radiusV );
416+ }
417+ rlEnd ();
418+ }
419+
420+ // Draw ellipse outline
421+ void DrawEllipseLines (int centerX , int centerY , float radiusH , float radiusV , Color color )
422+ {
423+ if (rlCheckBufferLimit (2 * 36 )) rlglDraw ();
424+
425+ rlBegin (RL_LINES );
426+ for (int i = 0 ; i < 360 ; i += 10 )
427+ {
428+ rlColor4ub (color .r , color .g , color .b , color .a );
429+ rlVertex2f (centerX + sinf (DEG2RAD * i )* radiusH , centerY + cosf (DEG2RAD * i )* radiusV );
430+ rlVertex2f (centerX + sinf (DEG2RAD * (i + 10 ))* radiusH , centerY + cosf (DEG2RAD * (i + 10 ))* radiusV );
431+ }
432+ rlEnd ();
402433}
403434
404435void DrawRing (Vector2 center , float innerRadius , float outerRadius , int startAngle , int endAngle , int segments , Color color )
0 commit comments