Added D3D support back in, made some other changes as well