[SDL] Re: Fill Circles (fastest circles)

Vlad Romascanu (LMC) Vlad.Romascanu at ericsson.ca
Sun Mar 17 18:34:00 PST 2002


Just use symmetry to draw 45deg. worth of filled circle and replicate it 8
times around your circle's origin.  If all you want to do is solid fill
then, depending on your hardware and colour depth, using 1:2 vertical
symmetry may be faster (upper part and bottom part: drawing horizontal lines
may be faster than setting individual bytes in the buffer).  And if you're
really nuts about performance you may want to use circle-specific lookup
tables for all the trig stuff.

Ellipses that are only squished circles can be done using the same algo,
just squish your x/y coordinates.  General ellipses have to be done more or
less the hard way.

V.




More information about the SDL mailing list