Пример #1
0
        /// <summary>
        ///
        /// </summary>
        public DXElement()
        {
            this.SnapsToDevicePixels = true;

            m_renderTimer = new Stopwatch();
            m_surface     = new D3D9ImageSource();

            m_surface.IsFrontBufferAvailableChanged += delegate
            {
                _needReset = true;
                UpdateReallyLoopRendering();
                if (!m_isReallyLoopRendering && m_surface.IsFrontBufferAvailable)
                {
                    Render();
                }
            };
            IsVisibleChanged += delegate { UpdateReallyLoopRendering(); };

            Action Dispose = () =>
            {
                IDisposable disposer = Renderer as IDisposable;
                if (disposer != null)
                {
                    try
                    {
                        disposer.Dispose();
                    }
                    catch
                    {
                    }
                }
                Renderer = null;
            };

            //this.Unloaded += (s, ea) => Dispose();
            this.Dispatcher.ShutdownStarted += (s, ea) => Dispose();
        }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="dximage"></param>
 public abstract void SetBackBuffer(D3D9ImageSource dximage);
Пример #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="dximage"></param>
 public override void SetBackBuffer(D3D9ImageSource dximage)
 {
     dximage.SetBackBuffer(RenderTarget);
 }