public void ShutDown() { // Release the camera object. Camera = null; // Release the particle system object. ParticleSystem?.ShutDown(); ParticleSystem = null; // Release the particle shader object. ParticleShader?.ShutDown(); ParticleShader = null; // Release the Direct3D object. D3D?.ShutDown(); D3D = null; }
// Methods public bool Initialize(DSystemConfiguration configuration, IntPtr windowsHandle) { try { // Create the Direct3D object. D3D = new DDX11(); // Initialize the Direct3D object. if (!D3D.Initialize(configuration, windowsHandle)) { return(false); } // Create the camera object Camera = new DCamera(); // Set the initial position of the camera. Camera.SetPosition(0.0f, -1.6f, -5.0f); // Create the particle shader object. ParticleShader = new DParticleShader(); // Initialize the particle shader object. if (!ParticleShader.Initialize(D3D.Device, windowsHandle)) { return(false); } // Create the particle system object. ParticleSystem = new DParticleSystem(); // Initialize the particle system object. if (!ParticleSystem.Initialize(D3D.Device, "star.bmp")) { return(false); } return(true); } catch { return(false); } }