The function drawLine in libwiiu only draws a horizontal or vertical line. So what if you want to draw a 30, 45, or 60 degree angle? I was doing some testing, and found the DDA Algorithm, modified to work with libwiiu, to be the best. So here is the code for the DDA Algorithm I modified. You can replace the normal drawLine function with it if you want, it works just as well.
Code:
void draw2DLine(int x1, int y1, int x2, int y2, char r, char g, char b)
{
int s, dx, dy, m;
float xi, yi, x, y;
dx = x2 - x1;
dy = y2 - y1;
if (abs(dx) > abs(dy)) {
s = dx;
}
else {
s = dy;
}
xi = dx / (float) s;
yi = dy / (float) s;
x = x1;
y = y1;
drawPixel(x1, y1, r, g, b);
if (s > m) {
m = 0;
for (m; m < s; m++) {
x += xi;
y += yi;
drawPixel(x, y, r, g, b);
}
}
else {
m = 0;
for (m; m > s; m--) {
x -= xi;
y -= yi;
drawPixel(x, y, r, g, b);
}
}
}