Skip to content
/ wfc Public

Simple implementation of wave function collapse algorithm in C.

License

Notifications You must be signed in to change notification settings

LogicEu/wfc

Repository files navigation

wfc

Implementation of the Wave Function Collapse algorithm as a header only solution in C99. If you want to learn about the algorithm I suggest you to check out the original implementation here. The image samples are taken from the original repo.

Header-Only

To acces the implementation details you need to define WFC_APPLICATION before including the wfc.h header file.

#define WFC_APPLICATION
#include "wfc.h"

You should only define WFC_APPLICATION in a single translation unit.

Dependencies

The only real dependency of wfc.h is utopia, a generic data structure and header-only library in C.

The demonstration program depends on imgtool, a simple wrapper around PNG, JPEG, and other formats to save and load images easily, and spxe, a simple pixel engine to render the output in real time with OpenGL.

Try it

On Linux and MacOS:

git clone --recursive https://github.com/LogicEu/wfc.git
cd wfc
make # or ./build.sh all
./wfc --help

About

Simple implementation of wave function collapse algorithm in C.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published