예제 #1
0
        /// <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 +=
        }
예제 #2
0
        /// <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);
            }
        }
예제 #3
0
        /// <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;
        }