Should have done this a long time ago. d3d.c remains as it is, because it's just a bunch of helper functions.