예제 #1
0
        /// <summary>
        /// Releases unmanaged and - optionally - managed resources
        /// </summary>
        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
        protected override void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    if (_blurStaticBuffer != null)
                    {
                        _blurStaticBuffer.Dispose();
                    }
                    if (_blurBuffer != null)
                    {
                        _blurBuffer.Dispose();
                    }
                    if (_blurKernelStream != null)
                    {
                        _blurKernelStream.Dispose();
                    }
                    if (Passes[0].PixelShader != null)
                    {
                        Passes[0].PixelShader.Dispose();
                    }

                    FreeResources();
                }

                Passes[0].PixelShader = null;
                _disposed             = true;
            }

            base.Dispose(disposing);
        }
예제 #2
0
파일: Program.cs 프로젝트: tmp7701/Gorgon
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                Initialize();
                Gorgon.Run(_mainForm, Idle);
            }
            catch (Exception ex)
            {
                GorgonException.Catch(ex, () => GorgonDialogs.ErrorBox(null, ex));
            }
            finally
            {
                if (_wvpBufferStream != null)
                {
                    _wvpBufferStream.Dispose();
                }

                if (Graphics != null)
                {
                    Graphics.Dispose();
                }
            }
        }
예제 #3
0
        public void CleanUp()
        {
            if (_bufferStream != null)
            {
                _bufferStream.Dispose();
            }

            if (_framework != null)
            {
                _framework.Dispose();
            }
        }
예제 #4
0
        /// <summary>
        /// Releases unmanaged and - optionally - managed resources.
        /// </summary>
        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
        private void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                if (_lightStore != null)
                {
                    _lightStore.Dispose();
                }

                if (_buffer != null)
                {
                    _buffer.Dispose();
                }
            }

            _disposed = true;
        }