Пример #1
0
        protected virtual void Dispose(bool disposing)
        {
            if (!IsDisposed)
            {
                if (disposing)
                {
                    // We're about to dispose, notify the application.
                    if (Disposing != null)
                    {
                        Disposing(this, EventArgs.Empty);
                    }

                    /* Dispose of all remaining graphics resources before
                     * disposing of the GraphicsDevice.
                     */
                    GraphicsResource.DisposeAll();

                    // Free all the cached shader programs.
                    programCache.Dispose();

                    // Dispose of the GL Device/Context
                    GLDevice.Dispose();
                }

                IsDisposed = true;
            }
        }
Пример #2
0
        private void PlatformDispose()
        {
            // Free all the cached shader programs.
            _programCache.Dispose();

            GraphicsDevice.AddDisposeAction(() =>
            {
                if (this.glRenderTargetFrameBuffer > 0)
                {
                    Framebuffer.Delete(this.glRenderTargetFrameBuffer);
                }

#if WINDOWS || LINUX || ANGLE
                Context.Dispose();
                Context = null;

                if (Threading.BackgroundContext != null)
                {
                    Threading.BackgroundContext.Dispose();
                    Threading.BackgroundContext = null;
                    Threading.WindowInfo        = null;
                }
#endif
            });
        }
Пример #3
0
        private void PlatformDispose()
        {
            // Free all the cached shader programs.
            _programCache.Dispose();

            GraphicsDevice.AddDisposeAction(() =>
            {
#if DESKTOPGL || ANGLE
                Context.Dispose();
                Context = null;
#endif
            });
        }
Пример #4
0
        protected virtual void Dispose(bool disposing)
        {
            if (!IsDisposed)
            {
                if (disposing)
                {
                    // Invoke the Disposing Event
                    OnDisposing();

                    // Dispose of all remaining graphics resources before disposing of the GraphicsDevice
                    GraphicsResource.DisposeAll();

                    // Free all the cached shader programs.
                    programCache.Dispose();
                }

                IsDisposed = true;
            }
        }
Пример #5
0
        private void PlatformDispose()
        {
            // Free all the cached shader programs.
            _programCache.Dispose();

            GraphicsDevice.AddDisposeAction(() =>
            {
#if WINDOWS || LINUX || ANGLE
                Context.Dispose();
                Context = null;

                if (Threading.BackgroundContext != null)
                {
                    Threading.BackgroundContext.Dispose();
                    Threading.BackgroundContext = null;
                    Threading.WindowInfo        = null;
                }
#endif
            });
        }
 private void PlatformDispose()
 {
     _programCache.Dispose();
 }