Drawing a line code

claptrap clap at trap.com
Sun Nov 6 11:40:40 UTC 2022


On Sunday, 6 November 2022 at 11:22:26 UTC, Joel wrote:
> I found some code on the net but haven't been able to get it 
> working properly. I trying to draw with mouse (any direction).

this is the classic integer line drawing algorithm...

https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm#Algorithm_for_integer_arithmetic

or you could use this...

https://github.com/cerjones/dg2d



More information about the Digitalmars-d-learn mailing list