private void HandleSurfaceDestroyed() { if (_backend == GraphicsBackend.Vulkan) { MainSwapchain.Dispose(); MainSwapchain = null; } else { GraphicsDevice.Dispose(); GraphicsDevice = null; MainSwapchain = null; DeviceDisposed?.Invoke(); } }
protected virtual void Dispose(bool disposing) { if (!_disposed) { if (disposing) { if (_deviceClient != null) { if (_started) { Stop().Wait(); } _deviceClient.Dispose(); DeviceDisposed?.Invoke(DeviceId); } } _disposed = true; } }