• Stars
    star
    861
  • Rank 52,968 (Top 2 %)
  • Language
    C
  • Created about 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

single-file C libraries from Philip Allan Rideout

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.

library description link
par_camera_control.h orbit controller, or pan-and-zoom like Google Maps demo project
par_octasphere.h malloc-free mesh gen for spheres and rounded cuboids blog post
par_streamlines.h triangulate wide lines and curves blog post
par_string_blocks.h string manager for snippets of Lua or GLSL
par_shapes.h generate parametric surfaces and other simple shapes blog 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:

  • Checks that no lines are more than 100 chars.
  • Checks for extra newlines before an end brace.

other libraries

library description link
par_bluenoise.h generate progressive 2D point sequences blog post
par_bubbles.h pack circles into hierarchical diagrams blog post
par_easings.h Robert Penner's easing functions
par_easycurl.h simple HTTP requests using libcurl
par_filecache.h LRU caching on your device's filesystem
par_sprune.h efficient broad-phase collision detection in 2D web demo
par_msquares.h unmaintained marching squares library (do not use) blog post

More Repositories

1

heman

C99 heightmap utilities.
C
470
star
2

snowy

Small Image Library for Python 3
Python
417
star
3

svg3d

generate 3D wireframes as vector art
Python
351
star
4

aobaker

ambient occlusion baking tool
C++
234
star
5

fluidsim

GPU fluid simulation
C
165
star
6

recipes

collection of tiny OpenGL demos
C
63
star
7

parg

tiny C library of various graphics utilities and GL demos
C++
56
star
8

lava

toy C++ Vulkan library
C++
49
star
9

clumpy

create or transform numpy images from the command line
C++
47
star
10

parm

minimal macOS Metal application
Objective-C++
41
star
11

iphone-3d-programming

sample code from my O'Reilly book
C
40
star
12

polygon.js

tessellation of concave polygons with holes in Javascript
JavaScript
39
star
13

distortion

Fisheye Distortion in OpenGL
C
36
star
14

knotgl

Mathematical Knots in WebGL
JavaScript
34
star
15

streamlines_demo

sample app for par_streamlines
C
31
star
16

pez

teeny tiny platform layer for simple OpenGL demos
C
26
star
17

quadmesh

Animated quad meshes and smooth normal computation with Modern OpenGL.
C
22
star
18

opengl-insights

source code for "An Introduction to Tessellation Shaders"
C
22
star
19

hexgl

HexGL clone using Filament and TypeScript
TypeScript
19
star
20

sympy-fun

use SymPy to generate equations for parametric surfaces
C
17
star
21

giza

low-level utility layer for WebGL
JavaScript
16
star
22

nile

fractal terrain generator in Nim
Nim
16
star
23

coregl-python

simple example of using the OpenGL Core Profile with PyQt, numpy, and PyOpenGL
Python
15
star
24

gltumble

spin a 3D object with a bit of inertia
JavaScript
14
star
25

knotess

prime knot tessellation
JavaScript
13
star
26

rwt

Recursive Wang tiles dataset for blue noise
C
13
star
27

euler

scrollytelling and Filament
TypeScript
11
star
28

effects-salad

C++
10
star
29

camera_demo

demo for par_camera_control.h
C
10
star
30

flatbin

Tiny JavaScript utility for parsing simple binary files.
JavaScript
9
star
31

govmath

vector math in go for 3D graphics
Go
9
star
32

reba-island

generate simple island shapes
C++
8
star
33

monarchy

demonstrates high-performance 2D graphics with giza
JavaScript
8
star
34

pageturn

TypeScript
8
star
35

lsystem

lsystem evaluation in C++, Go, and Python
C++
7
star
36

modern-opengl-prezo

HTML Slideshow on Modern OpenGL
C
7
star
37

skia

fork of skia that is CMake-buildable
C++
6
star
38

ribarchive

random renderman stuff
Slash
5
star
39

sfpaths

Download and visualize Strava paths with D3 and Google Maps.
Python
5
star
40

blog-source

my old graphics blog
C
3
star
41

d3cpp

sweep and prune demo
JavaScript
3
star
42

gorman

renderman bindings for the go language
Go
3
star
43

heman-python

work in progress
C
2
star
44

book-webgl

JavaScript
2
star
45

reba

dev machine for building server-side renderers
Shell
1
star
46

filasize

HTML
1
star
47

shaderhud

quick shader editor overlay for debugging
JavaScript
1
star
48

knot-data

Data for Mathematical Knots
CoffeeScript
1
star