Skip to content

Commit

Permalink
VideoCommon: Simplify VideoBackendBase::GetDefaultBackendName
Browse files Browse the repository at this point in the history
Now we can just call GetDefaultVideoBackend to get the default backend
and get its name by calling GetName.
  • Loading branch information
leoetlino committed Oct 21, 2020
1 parent aaaa389 commit d08b808
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Source/Core/VideoCommon/VideoBackendBase.cpp
Expand Up @@ -206,16 +206,10 @@ static VideoBackendBase* GetDefaultVideoBackend()
return backends.front().get();
}

// This function is called at static initialization, so we can't rely on s_default_backend being set
std::string VideoBackendBase::GetDefaultBackendName()
{
#ifdef HAS_OPENGL
return OGL::VideoBackend::NAME;
#elif defined(_WIN32)
return DX11::VideoBackend::NAME;
#else
return Vulkan::VideoBackend::NAME;
#endif
auto* default_backend = GetDefaultVideoBackend();
return default_backend ? default_backend->GetName() : "";
}

const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvailableBackends()
Expand Down

0 comments on commit d08b808

Please sign in to comment.