/// <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);
        }
Beispiel #2
0
        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();
                }
            }
        }
Beispiel #3
0
        public void CleanUp()
        {
            if (_bufferStream != null)
            {
                _bufferStream.Dispose();
            }

            if (_framework != null)
            {
                _framework.Dispose();
            }
        }
Beispiel #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;
        }