private void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) { if (isDXInitialized) { this.deviceContext.ClearState(); using (DXGI.Device3 dxgiDevice3 = this.device.QueryInterface <DXGI.Device3>()) dxgiDevice3.Trim(); } }
private void Application_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) { if (isDXInitialized) { this.deviceContext.ClearState(); using (DXGI.Device3 dxgiDevice3 = this.swapChain.GetDevice <DXGI.Device3>()) { dxgiDevice3.Trim(); } } }
private void Application_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) { // Check if resources have been initialized. if (isDXInitialized) { // Clear any object references. this.deviceContext.ClearState(); // Trim the memory. using (DXGI.Device3 dxgiDevice3 = this.swapChain.GetDevice <DXGI.Device3>()) { dxgiDevice3.Trim(); } } }
/// <summary> /// When the app is suspended, UWP apps should call Trim so that the DirectX data is cleaned. /// </summary> void Trim() { _device3?.Trim(); }