示例#1
0
        protected override void OnDispose(bool disposeManagedResources)
        {
            DisposingResources?.Invoke(this, EventArgs.Empty);
            foreach (var technique in techniqueDict.Values.ToArray())
            {
                if (technique.IsValueCreated)
                {
                    var t = technique.Value;
                    RemoveAndDispose(ref t);
                }
            }
            techniqueDict.Clear();
            RemoveAndDispose(ref shaderPoolManager);
            base.OnDispose(disposeManagedResources);
            Initialized = false;
            global::SharpDX.Toolkit.Graphics.WICHelper.Dispose();
#if DX11_1
            Disposer.RemoveAndDispose(ref device1);
#endif
            Disposer.RemoveAndDispose(ref device);
#if DEBUGMEMORY
            ReportResources();
#endif
            GC.SuppressFinalize(this);
        }
示例#2
0
        private void DisposeResources()
        {
            DisposingResources?.Invoke(this, EventArgs.Empty);
            foreach (var technique in techniqueDict.Values.ToArray())
            {
                if (technique.IsValueCreated)
                {
                    var t = technique.Value;
                    RemoveAndDispose(ref t);
                }
            }
            techniqueDict.Clear();
            RemoveAndDispose(ref geometryBufferManager);
            RemoveAndDispose(ref materialTextureManager);
            RemoveAndDispose(ref materialVariableManager);
            RemoveAndDispose(ref directWriteFactory);
            RemoveAndDispose(ref shaderPoolManager);
            RemoveAndDispose(ref constantBufferPool);
            RemoveAndDispose(ref statePoolManager);
            RemoveAndDispose(ref deviceContextPool);
            RemoveAndDispose(ref deviceContext2D);
            RemoveAndDispose(ref device2D);
            RemoveAndDispose(ref factory2D);
            RemoveAndDispose(ref wicImgFactory);
            RemoveAndDispose(ref structArrayPool);
            Initialized = false;
            global::SharpDX.Toolkit.Graphics.WICHelper.Dispose();
#if DX11_1
            RemoveAndDispose(ref device1);
#endif
            RemoveAndDispose(ref device);
#if DEBUGMEMORY
            ReportResources();
#endif
        }