32blit / 32blit-sdk

32blit SDK
https://32blit.com
MIT License
187 stars 67 forks source link

Missing graphics primitives #32

Open ali1234 opened 4 years ago

ali1234 commented 4 years ago

The following graphics primitives aren't implemented in the blit API. They probably should be for completeness:

An unfilled ellipse algorithm is described here: https://dai.fmph.uniba.sk/upload/0/01/Ellipse.pdf

Once ellipses are implemented, the circle implementations can be a wrapper around them to save space.

Filled polygons can be implemented by drawing filled triangles:

    for(n=1; n<(points-1); n++)
        triangle(p[0], p[n], p[n+1]);
ahnlak commented 3 years ago

Having just gone to look up the unfilled rectangle API function... is this still on the 'wanted' list? :-)

AnthonyDiGirolamo commented 2 years ago

+1 I'd like this

mikerr commented 1 year ago

Actually looking at this, filled polygon is already in the API:

void Surface::polygon(std::vector<Point> points)

and outline_circle is in primitive.cpp but commented out.

Gadgetoid commented 1 year ago

I wonder if it's worth porting https://github.com/lowfatcode/pretty-poly and https://github.com/lowfatcode/alright-fonts or a little ambitious.

Daft-Freak commented 1 year ago

:thinking: None of the examples use polygon, maybe we need a "primitives" example...

Got enough changes waiting for a release already though :laughing: