From d6f3a8848d005e00748b8e8f9a93ba84620160a3 Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 21 Aug 2020 15:02:52 +0200 Subject: [PATCH] Viewports: Backends: DirectX9: Allow D3DERR_DEVICELOST on secondary viewports. (#3424) --- examples/imgui_impl_dx9.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/imgui_impl_dx9.cpp b/examples/imgui_impl_dx9.cpp index 6d726af8..f8abc61a 100644 --- a/examples/imgui_impl_dx9.cpp +++ b/examples/imgui_impl_dx9.cpp @@ -408,7 +408,8 @@ static void ImGui_ImplDX9_SwapBuffers(ImGuiViewport* viewport, void*) { ImGuiViewportDataDx9* data = (ImGuiViewportDataDx9*)viewport->RendererUserData; HRESULT hr = data->SwapChain->Present(NULL, NULL, data->d3dpp.hDeviceWindow, NULL, NULL); - IM_ASSERT(hr == D3D_OK); + // Let main application handle D3DERR_DEVICELOST by resetting the device. + IM_ASSERT(hr == D3D_OK || hr == D3DERR_DEVICELOST); } static void ImGui_ImplDX9_InitPlatformInterface()