This is some code I wrote for a college mini-project.
Basic shapes are rectangles and circles (see classes/)
A system is a collection of any number of shapes and
forces acting on them.
System.AddTime(float dt) method
is used to advance the state of the system by dt seconds.
System.draw is used to draw it.
See main.cc for an example program using the library.
Rewrite in C