Home

Awesome

Build Status

par

Single-file C libraries under the MIT license, mostly graphics related. Documentation can be found at the top of each header file, but some libraries have an accompanying blog post. The most useful ones are listed in the following table.

librarydescriptionlink
par_camera_control.horbit controller, or pan-and-zoom like Google Mapsdemo project
par_octasphere.hmalloc-free mesh gen for spheres and rounded cuboidsblog post
par_streamlines.htriangulate wide lines and curvesblog post
par_string_blocks.hstring manager for snippets of Lua or GLSL
par_shapes.hgenerate parametric surfaces and other simple shapesblog post

There are more libraries too but they're probably less useful; scroll to the bottom of this README.

tests

To run tests, you need CMake and pkg-config. On macOS, these can be installed with homebrew:

$ brew install cmake pkg-config

Here's how you can tell CMake to use the CMakeLists in the test folder, placing all the messy stuff in a new folder called build.

$ cmake test -Bbuild   # Create makefiles
$ cmake --build build  # Invoke the build

The tests are executed by simply running the programs:

$ build/test_bubbles
$ build/test_shapes
$ build/test_octasphere

code formatting

This library's code style is strictly enforced to be vertically dense (no consecutive newlines) and 100 columns or less.

The tools/format.py script invokes a two-step code formatting process:

  1. Runs uncrustify with our custom configuration. This auto-formats all code in the root folder, up to a point.
  2. Checks for violations that are not otherwise enforced with uncrustify.

The aforementioned Python script is also invoked from Travis, but using the --check option, which checks for conformance without editing the code.

Beyond what our uncrustify configuration enforces, the Python script does the following:

other libraries

librarydescriptionlink
par_bluenoise.hgenerate progressive 2D point sequencesblog post
par_bubbles.hpack circles into hierarchical diagramsblog post
par_easings.hRobert Penner's easing functions
par_easycurl.hsimple HTTP requests using libcurl
par_filecache.hLRU caching on your device's filesystem
par_sprune.hefficient broad-phase collision detection in 2Dweb demo
par_msquares.hunmaintained marching squares library (do not use)blog post