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 else
m_swap_chain->Present(BoolToUInt32(m_vsync), 0); m_swap_chain->Present(BoolToUInt32(m_vsync), 0);
ImGui::NewFrame();
ImGui_ImplSDL2_NewFrame(m_window); ImGui_ImplSDL2_NewFrame(m_window);
ImGui_ImplDX11_NewFrame(); ImGui_ImplDX11_NewFrame();
} }

View File

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

View File

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