A simple generative art experiment built with SDL3 in C.
Multiple colored lines start from the center of the screen and perform a bounded random walk, creating evolving abstract patterns.
- Independent lines
- Random colors
- Bounded movement (no going outside window)
- Persistent drawing using a texture as canvas
Each frame:
- A random direction is chosen (X or Y axis)
- The line moves either positive or negative
- Boundary checks prevent leaving the screen
- A line is drawn from old position to new position
- Drawing accumulates over time on a texture
This creates a generative art random-walk effect.
random-walk/
│
├── SDL/ # SDL3 headers and library files
├── src/ # Source files (main.c)
├── .gitignore
├── Makefile # Build configuration (MinGW)
└── SDL3.dll # Required runtime DLL
- MinGW (GCC) – for compiling the project
- SDL3 development library – included inside this repository (SDL/ folder)
From project root:
mingw32-make
Or manually:
gcc src/main.c -ISDL/include -LSDL/lib -lmingw32 -lSDL3 -o main.exe
Make sure SDL3.dll is in the same directory as main.exe, then:
./main.exe
Built as part of learning SDL3 graphics programming in C.

