Sometimes, all you need is some simple drawing primitives

Bill Baxter dnewsgroup at billbaxter.com
Wed Sep 19 16:52:02 PDT 2007


Downs wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Here's some simple graphics primitives on top of SDL: pset, pget, line,
> circle and bucket-fill (paint).
> It's modelled after QBasic, which I still think has the most intuitive,
> easy to use graphics API I've seen so far.
> 
> The code is placed in the public domain.
> 
> On that account, does anybody know a good algorithm for drawing
> ellipses? The one I came up with is kind of broken for ratios around or
> over 1:5 ...

You can do a bresenham-style ellipse renderer.
Just google for "bresenham ellipse".  First hit I got was this paper:
http://homepage.smc.edu/kennedy_john/BELIPSE.PDF



More information about the Digitalmars-d mailing list