SDL: Move imgui render to display

Fixes crash on renderer switch.
This commit is contained in:
Connor McLaughlin 2020-02-23 00:04:30 +09:00
parent 49c7767ed4
commit bfdf343dfe
3 changed files with 2 additions and 3 deletions

View file

@ -364,6 +364,7 @@ void D3D11HostDisplay::Render()
else
m_swap_chain->Present(BoolToUInt32(m_vsync), 0);
ImGui::NewFrame();
ImGui_ImplSDL2_NewFrame(m_window);
ImGui_ImplDX11_NewFrame();
}

View file

@ -360,6 +360,7 @@ void OpenGLHostDisplay::Render()
SDL_GL_SwapWindow(m_window);
ImGui::NewFrame();
ImGui_ImplSDL2_NewFrame(m_window);
ImGui_ImplOpenGL3_NewFrame();

View file

@ -1290,11 +1290,8 @@ void SDLHostInterface::Run()
if (m_system)
m_system->GetGPU()->ResetGraphicsAPIState();
ImGui::Render();
m_display->Render();
ImGui::NewFrame();
if (m_system)
{
m_system->GetGPU()->RestoreGraphicsAPIState();