The code which draws line using Bresenham\'s algorithm is shown below (from Wikipedia):
void BresenhamLine(const int x1, const int y1, const int x2, const int y2)