Bitmap/Bresenham's line algorithm: Difference between revisions

Content added Content deleted
(→‎{{header|C++}}: minor bug fixed)
(cannot use const with std::swap, the values need to be writable!)
Line 917: Line 917:
=={{header|C++}}==
=={{header|C++}}==
<lang cpp>
<lang cpp>
void Line( const float x1, const float y1, const float x2, const float y2, const Color& color )
void Line( float x1, float y1, float x2, float y2, const Color& color )
{
{
// Bresenham's line algorithm
// Bresenham's line algorithm