[ create a new paste ] login | about

Link: http://codepad.org/O6SoAtr5    [ raw code | output | fork ]

C++, pasted on May 21:
void inc_line(int x1, int y1, int x2, int y2, int color){

int dx, dy, incE, incNE, d, x, y;

dx = x2 - x1;

dy = y2 - y1;

d = 2 * dy - dx; /* Valor inicial de d */

incE = 2 * dy; /* Incremento de E */

incNE = 2 * (dy - dx); /* Incremento de NE */

x = x1;

y = y1;

write_pixel(x, y, color);

while (x < x2){

if (d <= 0) {

/* Escolhe E */

d = d + incE;

x = x + 1;

}else{

/* Escolhe NE */

d = d + incNE;

x = x + 1;

y = y + 1;

}/* end if */

write_pixel(x, y, color);

}/* end while */

}/* end inc_line */


Output:
1
2
3
In function 'void inc_line(int, int, int, int, int)':
Line 19: error: 'write_pixel' was not declared in this scope
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: