prideout/par logo

prideout/par

Free

single-file C libraries from Philip Allan Rideout

FreeFree tier
Type
Open Source

About prideout/par

A collection of single-file C libraries under the MIT license, primarily focused on graphics programming. Includes modules for camera control (orbit/pan-zoom), mesh generation for spheres and rounded cuboids, wide line and curve triangulation, parametric shape generation, string management for Lua/GLSL snippets, progressive blue noise point generation, circle packing, easing functions, HTTP requests via libcurl, LRU file caching, and 2D collision detection. Each header contains documentation at the top, with some libraries accompanied by blog posts. The project is maintained by Philip Allan Rideout and includes a CMake-based test suite.

Key Features

Single-file headers for easy integration into projects
MIT license allows free commercial and personal use
Library for orbit camera control (par_camera_control.h)
Mesh generation for spheres and rounded cuboids (par_octasphere.h, malloc-free)
Wide line and curve triangulation (par_streamlines.h)
Parametric surface generation and simple shapes (par_shapes.h)
String manager for Lua or GLSL snippets (par_string_blocks.h)
Progressive 2D point sequences (par_bluenoise.h)
Circle packing into hierarchical diagrams (par_bubbles.h)
Easing functions from Robert Penner (par_easings.h)

Pros & Cons

Pros
  • Single-file headers make integration simple and dependency-free for most libraries
  • MIT license permits use in proprietary and open-source projects
  • Documentation available within each header file
  • Some libraries include accompanying blog posts with usage examples
  • Lightweight; minimal to no external dependencies
  • Includes automated test suite using CMake for verification
  • Active repository with 342 commits and community stars (997)
Cons
  • Some libraries (e.g., par_msquares.h) are unmaintained and marked 'do not use'
  • Documentation is limited to header comments; no separate manual or tutorials
  • No official releases or versioned packages; rely on git commits
  • par_easycurl.h requires libcurl, adding an external dependency
  • No prebuilt binaries or package manager integration

Best For

Graphics programming and game development3D model generation and rendering utilitiesPrototyping and learning computer graphicsData visualization with parametric shapesEmbedded or resource-constrained systems (malloc-free options)Real-time camera controllers for interactive applicationsProcedural content generation (noise, bubbles, shapes)

FAQ

What license does par use?
The libraries are licensed under the MIT license.
How do I run the tests?
Tests require CMake and pkg-config. On macOS, install via Homebrew, then run 'cmake test -Bbuild' to create makefiles and 'cmake --build build' to build. Execute the built programs to run tests.
Are there any external dependencies?
Most libraries have no external dependencies. However, par_easycurl.h requires libcurl for HTTP requests.
Is par suitable for embedded systems?
Yes, some libraries like par_octasphere.h are malloc-free, making them suitable for resource-constrained environments.