public void Shutdown()
 {
     // Release the Direct3D object.
     D3D?.ShutDown();
     D3D = null;
 }