GitHub - gotoc/simple2d: A simple, open-source 2D graphics engine for everyone.

A simple 2D graphics engine written in C. Check out the website ยป

Build and install with:

Running Tests

Getting Test Media

To keep the size of this repository small, media needed for tests are checked into the test_media repo and referenced as a Git submodule. After cloning this repo, init the submodule and get its contents using:

git submodule init
git submodule update --remote

Alternatively, you can clone the repo and update the submodule in one step using:

git clone --recursive https://github.com/simple2d/simple2d.git

Simply run git submodule update --remote anytime to get the latest changes from test_media (i.e. when there's a new commit available).

Building the Tests

Simply run make tests. Built tests are placed in the tests/ directory with the same name as their C source file.

Available Tests

  • triangle.c โ€“ The "hello triangle" example from the simple2d.com website.
  • testcard.c โ€“ A graphical card similar to testcards in TV, testing a wide range of visual capabilities.
  • audio.c โ€“ Tests audio functions with different file formats interpreted as samples and music.

Run a test using make tests && cd tests/ && ./<name_of_test>, for example:

make tests && cd tests/ && ./triangle

Or, conveniently run tests using bash test.sh <name_of_test>, for example:

# Run triangle.c
bash test.sh triangle

# Run audio.c
bash test.sh audio