Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.
/ WU_Algorithm Public archive

Testing Xiaolin Wu's line algorithm on C using SDL2.

Notifications You must be signed in to change notification settings

Iipal/WU_Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WU Algorithm

made by tmaluh (_ipal)

Testing Xiaolin Wu's line algorithm on C using SDL2.

screenshot

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.

Requirements pre-installations:

Fedora:

$> sudo dnf install SDL2-devel-2.0.9-3.fc30.x86_64

MacOS:

$> brew install sdl2

Compiling

Use 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 clean to 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 -g3 for debug.

Keybinds:

Description Key
Re-random all line positions R
Exit. ESC

Flags:

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

screenshot2

Releases

No releases published

Packages

No packages published