mirror of
https://github.com/ocornut/imgui.git
synced 2025-10-15 22:46:01 +00:00
Backends: DX10, DX11: avoid ImGui_ImplXXXX_SwapBuffers() handlers for secondary viewports crashing if SwapChain could not be created.
It's not really clear when that would fail but someone privately reported, and since we allow failure in ImGui_ImplDX11_CreateWindow() it makes sense to allow it here.
This commit is contained in:
@@ -800,7 +800,8 @@ static void ImGui_ImplDX11_RenderWindow(ImGuiViewport* viewport, void*)
|
||||
static void ImGui_ImplDX11_SwapBuffers(ImGuiViewport* viewport, void*)
|
||||
{
|
||||
ImGui_ImplDX11_ViewportData* vd = (ImGui_ImplDX11_ViewportData*)viewport->RendererUserData;
|
||||
vd->SwapChain->Present(0, 0); // Present without vsync
|
||||
if (vd->SwapChain)
|
||||
vd->SwapChain->Present(0, 0); // Present without vsync
|
||||
}
|
||||
|
||||
static void ImGui_ImplDX11_InitMultiViewportSupport()
|
||||
|
Reference in New Issue
Block a user