Creator, on 16 April 2015 - 06:06 PM, said:

awsumben13, on 16 March 2015 - 10:14 PM, said:

One quick question... How did you implement :drawTriangle()? Surely you're using the scanline method, and if so, it's not any harder to implement a :drawPolygon() function.

@awesumben every post that is about gui you ask for a triangle drawing function and a polygon drawing function. What is the math behind circles triangles and polygons in general?

It may not be the fastest way of drawing, but it doesn't have any artifacts.

Here are a few sources that may help you if you're interested in real scanline algorithms:

Sofware Rasterization Algorithms for drawing filled triangles

Triangle fillers

Polygon Fill Teaching Tool

Circle and ellipse drawing algorithm - Math Open Reference