Testing Xiaolin Wu's line algorithm on C using SDL2.
Randomized start and end lines positions on each ./wu_algo startup. If you wants to change randomatic lines counter - use flag --linesCounter(described below), default is: 10.
Fedora:
$> sudo dnf install SDL2-devel-2.0.9-3.fc30.x86_64MacOS:
$> brew install sdl2Use make for compiling all files.
When you have already installed SDL2 library you can use this simple rules:
- make: Compile all. (On Fedora can require password if SDL2 libraries not installed)
- make clean: Delete all ./wu_algo temporary(
*.o) files. - make del: In this project equals to make fclean.
- make fclean: Expands
make cleanto delete also executable ./wu_algo. - make re: It's rules - make fclean & make in one.
- make pre: It's rules - make del & make in one.
- make debug: Re-compile ./wu_algo without optimization flags but with
-g3for debug.
| Description | Key |
|---|---|
| Re-random all line positions | R |
| Exit. | ESC |
| Flag | Description | Shortcut | Default value | Param type |
|---|---|---|---|---|
| --maxLineLength | Set max randomize line length. | -mll | equals to WIN_X | Unsigned integer. (Min: 25; Max: equals to Default Value;) |
| --linesCounter | Set how much lines radnomize, calculate and draw. | -lc | 10 | Unsigned Integer. (Min: 1; Max: 1500000) |
| --foregroundColor | Change foreground(lines) color. | -fgc | 0xffffff | HEX string, starts with '0x'. |
| --backgroundColor | Change background color. | -bgc | 0x0 | HEX string, starts with '0x'. |
Example:
$> ./wu_algo -lc 1000 -bgc 0xaa00ff -fgc 0x1ffff
