Frontend: Prevent drawing imgui into the vram texture

This commit is contained in:
Connor McLaughlin
2019-10-04 22:27:18 +10:00
parent 4fa79f1503
commit 004c22f031
6 changed files with 19 additions and 19 deletions

View File

@ -388,6 +388,8 @@ bool SDLInterface::PassEventToImGui(const SDL_Event* event)
void SDLInterface::Render()
{
DrawImGui();
m_system->GetGPU()->ResetGraphicsAPIState();
glBindFramebuffer(GL_FRAMEBUFFER, 0);
@ -396,8 +398,6 @@ void SDLInterface::Render()
RenderDisplay();
RenderImGui();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
SDL_GL_SwapWindow(m_window);
@ -459,19 +459,19 @@ void SDLInterface::RenderDisplay()
glDrawArrays(GL_TRIANGLES, 0, 3);
}
void SDLInterface::RenderImGui()
void SDLInterface::DrawImGui()
{
RenderMainMenuBar();
DrawMainMenuBar();
if (m_show_gpu_statistics)
m_system->GetGPU()->RenderStatistics();
m_system->GetGPU()->DrawStatistics();
RenderOSDMessages();
DrawOSDMessages();
ImGui::Render();
}
void SDLInterface::RenderMainMenuBar()
void SDLInterface::DrawMainMenuBar()
{
if (!ImGui::BeginMainMenuBar())
return;
@ -555,7 +555,7 @@ void SDLInterface::RenderMainMenuBar()
ImGui::MenuItem("Show Statistics", nullptr, &m_show_gpu_statistics);
ImGui::Separator();
m_system->GetGPU()->RenderDebugMenu();
m_system->GetGPU()->DrawDebugMenu();
ImGui::EndMenu();
}
@ -603,7 +603,7 @@ void SDLInterface::SetDisplayTexture(GL::Texture* texture, u32 offset_x, u32 off
m_display_texture_changed = true;
}
void SDLInterface::RenderOSDMessages()
void SDLInterface::DrawOSDMessages()
{
constexpr ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoInputs |
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings |

View File

@ -50,7 +50,7 @@ private:
// We only pass mouse input through if it's grabbed
bool IsWindowFullscreen() const;
void RenderImGui();
void DrawImGui();
void DoLoadState(u32 index);
void DoSaveState(u32 index);
@ -58,8 +58,8 @@ private:
bool PassEventToImGui(const SDL_Event* event);
void Render();
void RenderDisplay();
void RenderMainMenuBar();
void RenderOSDMessages();
void DrawMainMenuBar();
void DrawOSDMessages();
SDL_Window* m_window = nullptr;
SDL_GLContext m_gl_context = nullptr;