diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index 5356e4a06..8f9bf4460 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -139,9 +139,9 @@ void GPU::ResetGraphicsAPIState() {} void GPU::RestoreGraphicsAPIState() {} -void GPU::RenderStatistics() {} +void GPU::DrawStatistics() {} -void GPU::RenderDebugMenu() +void GPU::DrawDebugMenu() { ImGui::MenuItem("Show VRAM", nullptr, &m_debug_options.show_vram); ImGui::MenuItem("Dump CPU to VRAM Copies", nullptr, &m_debug_options.dump_cpu_to_vram_copies); diff --git a/src/core/gpu.h b/src/core/gpu.h index 1ee1a868e..94288be60 100644 --- a/src/core/gpu.h +++ b/src/core/gpu.h @@ -40,10 +40,10 @@ public: virtual void RestoreGraphicsAPIState(); // Render statistics debug window. - virtual void RenderStatistics(); + virtual void DrawStatistics(); // Manipulating debug options. - virtual void RenderDebugMenu(); + virtual void DrawDebugMenu(); // Called when settings change. virtual void UpdateSettings(); diff --git a/src/core/gpu_hw_opengl.cpp b/src/core/gpu_hw_opengl.cpp index 5468549d5..2795346d0 100644 --- a/src/core/gpu_hw_opengl.cpp +++ b/src/core/gpu_hw_opengl.cpp @@ -68,9 +68,9 @@ void GPU_HW_OpenGL::RestoreGraphicsAPIState() glBindVertexArray(m_vao_id); } -void GPU_HW_OpenGL::RenderStatistics() +void GPU_HW_OpenGL::DrawStatistics() { - GPU_HW::RenderStatistics(); + GPU_HW::DrawStatistics(); ImGui::SetNextWindowSize(ImVec2(300.0f, 130.0f), ImGuiCond_Once); diff --git a/src/core/gpu_hw_opengl.h b/src/core/gpu_hw_opengl.h index a117230d0..4d44c96df 100644 --- a/src/core/gpu_hw_opengl.h +++ b/src/core/gpu_hw_opengl.h @@ -19,7 +19,7 @@ public: void ResetGraphicsAPIState() override; void RestoreGraphicsAPIState() override; - void RenderStatistics() override; + void DrawStatistics() override; void UpdateSettings() override; protected: diff --git a/src/duckstation/sdl_interface.cpp b/src/duckstation/sdl_interface.cpp index 58a60bd50..015b33462 100644 --- a/src/duckstation/sdl_interface.cpp +++ b/src/duckstation/sdl_interface.cpp @@ -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 | diff --git a/src/duckstation/sdl_interface.h b/src/duckstation/sdl_interface.h index c5eb8166f..19d76462b 100644 --- a/src/duckstation/sdl_interface.h +++ b/src/duckstation/sdl_interface.h @@ -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;