A bunch of common code which I use in my DirectX projects.