From 47a86d920f965a3799fa5f46734497b88e8eba0a Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Sun, 3 Nov 2024 11:35:47 -0800 Subject: [PATCH] GeneralWidget: Recommend default video backend in tooltip Recommend the platform's default video backend in the Backend tooltip instead of always recommending OpenGL. --- Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp | 6 ++++-- Source/Core/VideoCommon/VideoBackendBase.cpp | 6 ++++++ Source/Core/VideoCommon/VideoBackendBase.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp index 3574e6893a..b5f5a6b05a 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp @@ -239,7 +239,7 @@ void GeneralWidget::AddDescriptions() "recommended. Different games and different GPUs will behave differently on each " "backend, so for the best emulation experience it is recommended to try each and " "select the backend that is least problematic.

If unsure, " - "select OpenGL."); + "select %1."); static const char TR_FULLSCREEN_DESCRIPTION[] = QT_TR_NOOP("Uses the entire screen for rendering.

If disabled, a " "render window will be created instead.

If " @@ -311,7 +311,9 @@ void GeneralWidget::AddDescriptions() "unsure, leave this unchecked."); m_backend_combo->SetTitle(tr("Backend")); - m_backend_combo->SetDescription(tr(TR_BACKEND_DESCRIPTION)); + m_backend_combo->SetDescription( + tr(TR_BACKEND_DESCRIPTION) + .arg(QString::fromStdString(VideoBackendBase::GetDefaultBackendDisplayName()))); m_adapter_combo->SetTitle(tr("Adapter")); diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp index d545311fd7..e8f9f91b41 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.cpp +++ b/Source/Core/VideoCommon/VideoBackendBase.cpp @@ -228,6 +228,12 @@ std::string VideoBackendBase::GetDefaultBackendConfigName() return default_backend ? default_backend->GetName() : ""; } +std::string VideoBackendBase::GetDefaultBackendDisplayName() +{ + auto* const default_backend = GetDefaultVideoBackend(); + return default_backend ? default_backend->GetDisplayName() : ""; +} + const std::vector>& VideoBackendBase::GetAvailableBackends() { static auto s_available_backends = [] { diff --git a/Source/Core/VideoCommon/VideoBackendBase.h b/Source/Core/VideoCommon/VideoBackendBase.h index 76771ae49c..2ddfc284ca 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.h +++ b/Source/Core/VideoCommon/VideoBackendBase.h @@ -65,6 +65,7 @@ public: u16 Video_GetBoundingBox(int index); static std::string GetDefaultBackendConfigName(); + static std::string GetDefaultBackendDisplayName(); static const std::vector>& GetAvailableBackends(); static void ActivateBackend(const std::string& name);