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; } }
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 }); }
private void PlatformDispose() { // Free all the cached shader programs. _programCache.Dispose(); GraphicsDevice.AddDisposeAction(() => { #if DESKTOPGL || ANGLE Context.Dispose(); Context = null; #endif }); }
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; } }
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(); }