diff --git a/Source/Core/VideoBackends/D3D/VideoBackend.h b/Source/Core/VideoBackends/D3D/VideoBackend.h index 363c4b5068..a6d3f45edc 100644 --- a/Source/Core/VideoBackends/D3D/VideoBackend.h +++ b/Source/Core/VideoBackends/D3D/VideoBackend.h @@ -21,7 +21,7 @@ class VideoBackend : public VideoBackendBase void Video_Prepare() override; void Video_Cleanup() override; - void ShowConfig(void* parent) override; + void InitBackendInfo() override; unsigned int PeekMessages() override; diff --git a/Source/Core/VideoBackends/D3D/main.cpp b/Source/Core/VideoBackends/D3D/main.cpp index 791eda2a08..c900e2aa37 100644 --- a/Source/Core/VideoBackends/D3D/main.cpp +++ b/Source/Core/VideoBackends/D3D/main.cpp @@ -66,7 +66,7 @@ std::string VideoBackend::GetConfigName() const return "gfx_dx11"; } -void InitBackendInfo() +void VideoBackend::InitBackendInfo() { HRESULT hr = DX11::D3D::LoadDXGI(); if (SUCCEEDED(hr)) @@ -143,12 +143,6 @@ void InitBackendInfo() DX11::D3D::UnloadD3D(); } -void VideoBackend::ShowConfig(void* hParent) -{ - InitBackendInfo(); - Host_ShowVideoConfig(hParent, GetDisplayName(), GetConfigName()); -} - bool VideoBackend::Initialize(void* window_handle) { if (window_handle == nullptr) diff --git a/Source/Core/VideoBackends/D3D12/VideoBackend.h b/Source/Core/VideoBackends/D3D12/VideoBackend.h index 2efb3fba69..207a768477 100644 --- a/Source/Core/VideoBackends/D3D12/VideoBackend.h +++ b/Source/Core/VideoBackends/D3D12/VideoBackend.h @@ -21,7 +21,7 @@ class VideoBackend : public VideoBackendBase void Video_Prepare() override; void Video_Cleanup() override; - void ShowConfig(void* parent) override; + void InitBackendInfo() override; unsigned int PeekMessages() override; diff --git a/Source/Core/VideoBackends/D3D12/main.cpp b/Source/Core/VideoBackends/D3D12/main.cpp index 5fc1658c9f..8604735706 100644 --- a/Source/Core/VideoBackends/D3D12/main.cpp +++ b/Source/Core/VideoBackends/D3D12/main.cpp @@ -67,7 +67,7 @@ std::string VideoBackend::GetConfigName() const return "gfx_dx12"; } -void InitBackendInfo() +void VideoBackend::InitBackendInfo() { HRESULT hr = D3D::LoadDXGI(); if (FAILED(hr)) @@ -157,12 +157,6 @@ void InitBackendInfo() D3D::UnloadDXGI(); } -void VideoBackend::ShowConfig(void* hParent) -{ - InitBackendInfo(); - Host_ShowVideoConfig(hParent, GetDisplayName(), GetConfigName()); -} - bool VideoBackend::Initialize(void* window_handle) { if (window_handle == nullptr) diff --git a/Source/Core/VideoBackends/Null/NullBackend.cpp b/Source/Core/VideoBackends/Null/NullBackend.cpp index 2a1555ed27..6d66a6920f 100644 --- a/Source/Core/VideoBackends/Null/NullBackend.cpp +++ b/Source/Core/VideoBackends/Null/NullBackend.cpp @@ -32,7 +32,7 @@ namespace Null { -static void InitBackendInfo() +void VideoBackend::InitBackendInfo() { g_Config.backend_info.APIType = API_NONE; g_Config.backend_info.bSupportsExclusiveFullscreen = true; @@ -50,12 +50,6 @@ static void InitBackendInfo() g_Config.backend_info.AAModes = {1}; } -void VideoBackend::ShowConfig(void* parent) -{ - InitBackendInfo(); - Host_ShowVideoConfig(parent, GetDisplayName(), GetConfigName()); -} - bool VideoBackend::Initialize(void* window_handle) { InitializeShared(); diff --git a/Source/Core/VideoBackends/Null/VideoBackend.h b/Source/Core/VideoBackends/Null/VideoBackend.h index 46b7e39fc4..f853350de0 100644 --- a/Source/Core/VideoBackends/Null/VideoBackend.h +++ b/Source/Core/VideoBackends/Null/VideoBackend.h @@ -19,7 +19,7 @@ class VideoBackend : public VideoBackendBase void Video_Prepare() override; void Video_Cleanup() override; - void ShowConfig(void* parent) override; + void InitBackendInfo() override; unsigned int PeekMessages() override { return 0; } }; diff --git a/Source/Core/VideoBackends/OGL/VideoBackend.h b/Source/Core/VideoBackends/OGL/VideoBackend.h index b658615dd8..3f3d76b5cf 100644 --- a/Source/Core/VideoBackends/OGL/VideoBackend.h +++ b/Source/Core/VideoBackends/OGL/VideoBackend.h @@ -21,7 +21,7 @@ class VideoBackend : public VideoBackendBase void Video_Prepare() override; void Video_Cleanup() override; - void ShowConfig(void* parent) override; + void InitBackendInfo() override; unsigned int PeekMessages() override; }; diff --git a/Source/Core/VideoBackends/OGL/main.cpp b/Source/Core/VideoBackends/OGL/main.cpp index 9f08f62601..142004cbc3 100644 --- a/Source/Core/VideoBackends/OGL/main.cpp +++ b/Source/Core/VideoBackends/OGL/main.cpp @@ -111,7 +111,7 @@ static std::vector GetShaders(const std::string& sub_dir = "") return result; } -static void InitBackendInfo() +void VideoBackend::InitBackendInfo() { g_Config.backend_info.APIType = API_OPENGL; g_Config.backend_info.bSupportsExclusiveFullscreen = false; @@ -137,14 +137,6 @@ static void InitBackendInfo() g_Config.backend_info.AnaglyphShaders = GetShaders(ANAGLYPH_DIR DIR_SEP); } -void VideoBackend::ShowConfig(void* parent_handle) -{ - if (!m_initialized) - InitBackendInfo(); - - Host_ShowVideoConfig(parent_handle, GetDisplayName(), GetConfigName()); -} - bool VideoBackend::Initialize(void* window_handle) { InitBackendInfo(); diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index f37bc4aa14..d5b9bed4ca 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -139,7 +139,7 @@ std::string VideoSoftware::GetConfigName() const return "gfx_software"; } -static void InitBackendInfo() +void VideoSoftware::InitBackendInfo() { g_Config.backend_info.APIType = API_NONE; g_Config.backend_info.bSupports3DVision = false; @@ -152,13 +152,6 @@ static void InitBackendInfo() g_Config.backend_info.AAModes = {1}; } -void VideoSoftware::ShowConfig(void* hParent) -{ - if (!m_initialized) - InitBackendInfo(); - Host_ShowVideoConfig(hParent, GetDisplayName(), GetConfigName()); -} - bool VideoSoftware::Initialize(void* window_handle) { InitBackendInfo(); diff --git a/Source/Core/VideoBackends/Software/VideoBackend.h b/Source/Core/VideoBackends/Software/VideoBackend.h index 121961c21c..4cca26462e 100644 --- a/Source/Core/VideoBackends/Software/VideoBackend.h +++ b/Source/Core/VideoBackends/Software/VideoBackend.h @@ -26,7 +26,7 @@ class VideoSoftware : public VideoBackendBase void Video_Prepare() override; void Video_Cleanup() override; - void ShowConfig(void* parent) override; + void InitBackendInfo() override; unsigned int PeekMessages() override; }; diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp index a084e0cc09..c51515eb89 100644 --- a/Source/Core/VideoCommon/MainBase.cpp +++ b/Source/Core/VideoCommon/MainBase.cpp @@ -9,6 +9,7 @@ #include "Common/Event.h" #include "Common/Flag.h" #include "Common/Logging/Log.h" +#include "Core/ConfigManager.h" #include "Core/Host.h" #include "VideoCommon/AsyncRequests.h" #include "VideoCommon/BPStructs.h" @@ -157,6 +158,14 @@ u16 VideoBackendBase::Video_GetBoundingBox(int index) return result; } +void VideoBackendBase::ShowConfig(void* parent_handle) +{ + if (!m_initialized) + InitBackendInfo(); + + Host_ShowVideoConfig(parent_handle, GetDisplayName(), GetConfigName()); +} + void VideoBackendBase::InitializeShared() { memset(&g_main_cp_state, 0, sizeof(g_main_cp_state)); diff --git a/Source/Core/VideoCommon/VideoBackendBase.h b/Source/Core/VideoCommon/VideoBackendBase.h index a5571c98fc..ab0703b3a8 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.h +++ b/Source/Core/VideoCommon/VideoBackendBase.h @@ -75,7 +75,8 @@ public: virtual std::string GetDisplayName() const { return GetName(); } virtual std::string GetConfigName() const = 0; - virtual void ShowConfig(void*) = 0; + void ShowConfig(void*); + virtual void InitBackendInfo() = 0; virtual void Video_Prepare() = 0; void Video_ExitLoop();