As a longstanding user of SDL2_gfx I have become aware of some omissions and inconsistencies in the library. For example whilst you can draw a ‘thick’ straight line there are no functions for drawing thick circles or ellipses, and whilst you can draw an antialiased outline circle, there are no functions for drawing an antialiased filled circle.
So I have attempted to address this issue by writing my own extensions to the library. I have added the following functions to my copy:
thickEllipseColor() / thickEllipseRGBA(): Draw a 'thick' outline ellipse thickArcColor() / thickArcRGBA(): Draw a 'thick' circular arc thickCircleColor() / thickCircleRGBA(): Draw a 'thick' outline circle. aaFilledEllipseColor() / aaFilledEllipseRGBA(): Draw an antialiased filled elllipse. aaFilledPolygonColor() / aaFilledPolygonRGBA(): Draw an antialiased filled polygon. aaFilledPieColor() / aaFilledPieRGBA(): Draw an antialiased filled sector or segment. aaArcColor() / aaArcRGBA(): Draw an antialiased elliptical arc. aaBezierColor() / aaBezierRGBA(): Draw an antialiased Bézier curve. aaFilledPolyBezierColor() / aaFilledPolyBezierRGBA(): Draw an antialiased shape bounded by a cubic polyBézier.
Unlike the antialiased drawing functions in the original library, which surprisingly take only integer coordinates, my antialiased routines all take floating point parameters for coordinates and line thickness etc.
The code for these extensions can be found here, starting from line 4402. I have tried to do a reasonable amount of testing but if you find a bug please let me know.
Here’s an an example of a graphic created using these routines: