Exemple #1
0
 public void Dispose()
 {
     Vertices.Dispose();
     Indices.Dispose();
 }
Exemple #2
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)
            {
                return;
            }

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

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

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

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

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

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

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

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

            _disposed = true;
        }