Пример #1
0
        /// <summary>
        ///
        /// </summary>
        private bool StartD3D()
        {
            if (!loaded || EffectsManager == null || RenderTechniquesManager == null)
            {
                if (EffectsManager == null)
                {
                    EffectsManager = defaultEffectsManager = new DefaultEffectsManager(new DefaultRenderTechniquesManager());
                }
                //RenderTechniquesManager = DefaultRenderTechniquesManagerObj.Value;
                //EffectsManager = DefaultEffectsManagerObj.Value;
                return(false); // StardD3D() is called from DP changed handler
            }

            surfaceD3D = new DX11ImageSource(EffectsManager.AdapterIndex);
            surfaceD3D.IsFrontBufferAvailableChanged += OnIsFrontBufferAvailableChanged;
            device           = EffectsManager.Device;
            deferredRenderer = new DeferredRenderer();
            renderRenderable.DeferredRenderer = deferredRenderer;

            CreateAndBindTargets();
            SetDefaultRenderTargets();
            Source = surfaceD3D;
            InvalidateRender();
            return(true);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        private void StartD3D()
        {
            this.surfaceD3D = new DX11ImageSource();
            this.surfaceD3D.IsFrontBufferAvailableChanged += this.OnIsFrontBufferAvailableChanged;
            this.device           = EffectsManager.Device;
            this.deferredRenderer = new DeferredRenderer();
            this.renderRenderable.DeferredRenderer = this.deferredRenderer;

            this.CreateAndBindTargets();
            this.SetDefaultRenderTargets();
            this.Source = this.surfaceD3D;
        }
Пример #3
0
            public void CreateImageSource(int adapterIdx)
            {
                var cd = Dispatcher.CurrentDispatcher;

                SynchronizeToCurrentThread(() => {
                    image.Source = null;
                    Disposer.RemoveAndDispose(ref surfaceD3D);
                    surfaceD3D   = new DX11ImageSource(adapterIdx);
                    image.Source = surfaceD3D;
                    surfaceD3D.IsFrontBufferAvailableChanged +=
                        (s, e) => cd.BeginInvoke(new Action(() => IsFrontBufferAvailableChanged(s, e)));
                });
            }
Пример #4
0
        /// <summary>
        ///
        /// </summary>
        private void StartD3D()
        {
            if (EffectsManager == null || RenderTechniquesManager == null)
            {
                // Make sure both are null
                RenderTechniquesManager = null;
                EffectsManager          = null;
                RenderTechniquesManager = new DefaultRenderTechniquesManager();
                EffectsManager          = new DefaultEffectsManager(RenderTechniquesManager);
                return; // StardD3D() is called from DP changed handler
            }

            surfaceD3D = new DX11ImageSource(EffectsManager.AdapterIndex);
            surfaceD3D.IsFrontBufferAvailableChanged += OnIsFrontBufferAvailableChanged;
            device           = EffectsManager.Device;
            deferredRenderer = new DeferredRenderer();
            renderRenderable.DeferredRenderer = deferredRenderer;

            CreateAndBindTargets();
            SetDefaultRenderTargets();
            Source = surfaceD3D;
            InvalidateRender();
        }
Пример #5
0
        /// <summary>
        /// 
        /// </summary>
        private void StartD3D()
        {
            this.surfaceD3D = new DX11ImageSource();
            this.surfaceD3D.IsFrontBufferAvailableChanged += this.OnIsFrontBufferAvailableChanged;
            this.device = EffectsManager.Device;
            this.deferredRenderer = new DeferredRenderer();
            this.renderRenderable.DeferredRenderer = this.deferredRenderer;

            this.CreateAndBindTargets();
            this.SetDefaultRenderTargets();
            this.Source = this.surfaceD3D;
        }
Пример #6
0
        /// <summary>
        /// 
        /// </summary>
        private void StartD3D()
        {
            if (EffectsManager == null || RenderTechniquesManager == null)
            {
                // Make sure both are null
                RenderTechniquesManager = null;
                EffectsManager = null;
                RenderTechniquesManager = new DefaultRenderTechniquesManager();
                EffectsManager = new DefaultEffectsManager(RenderTechniquesManager);
                return; // StardD3D() is called from DP changed handler
            }

            surfaceD3D = new DX11ImageSource();
            surfaceD3D.IsFrontBufferAvailableChanged += OnIsFrontBufferAvailableChanged;
            device = EffectsManager.Device;
            deferredRenderer = new DeferredRenderer();
            renderRenderable.DeferredRenderer = deferredRenderer;

            CreateAndBindTargets();
            SetDefaultRenderTargets();
            Source = surfaceD3D;
            InvalidateRender();
        }
Пример #7
0
        /// <summary>
        /// 
        /// </summary>
        private void StartD3D()
        {
            surfaceD3D = new DX11ImageSource();
            surfaceD3D.IsFrontBufferAvailableChanged += OnIsFrontBufferAvailableChanged;
            device = EffectsManager.Device;
            deferredRenderer = new DeferredRenderer();
            renderRenderable.DeferredRenderer = deferredRenderer;

            CreateAndBindTargets();
            SetDefaultRenderTargets();
            Source = surfaceD3D;
            InvalidateRender();
        }