/// <summaray> /// Default Constructor /// </summaray> public D3DAppBase() { // Create our device manager instance. // This encapsulates the creation of Direct3D and Direct2D devices _deviceManager = ToDispose(new MyDeviceManager()); // If the device needs to be reinitialized, make sure we // are able to recreate our device dependent resources. //DeviceManager.OnInitialize += }
/// <summary> /// Create device dependent resources /// </summary> /// <param name="deviceManager"></param> protected virtual void CreateDeviceDependentResources(MyDeviceManager deviceManager) { if (_swapChain1 != null) { // Release the swap chain RemoveAndDispose(ref _swapChain1); // Force reinitialize size dependent resources SizeChanged(true); } }
/// <summary> /// Default constructor /// </summary> public D3DApplicationBase() { // Create our device manager instance. // This encapsulates the creation of Direct3D and Direct2D devices _deviceManager = ToDispose(new MyDeviceManager()); // If the device needs to be reinitialized, make sure we // are able to recreate our device dependent resources. DeviceManager.OnInitialize += CreateDeviceDependentResources; // If the size changes, make sure we reinitialize // any size dependent resources. this.OnSizeChanged += CreateSizeDependentResources; }