SDL: Move imgui render to display
Fixes crash on renderer switch.
This commit is contained in:
parent
49c7767ed4
commit
bfdf343dfe
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue