Updated to use D3D9