Add GraphicsDevice option and fix error in Config class to accept strings.

Co-authored-by: Hyper <34012267+hyperbx@users.noreply.github.com>
This commit is contained in:
Dario 2025-02-10 17:14:56 -03:00
parent 06fa3f464e
commit b34b4bde0f
3 changed files with 4 additions and 2 deletions

View file

@ -1615,7 +1615,7 @@ bool Video::CreateHostDevice(const char *sdlVideoDriver)
g_interface = interfaceFunction();
if (g_interface != nullptr)
{
g_device = g_interface->createDevice();
g_device = g_interface->createDevice(Config::GraphicsDevice);
if (g_device != nullptr)
{
#ifdef UNLEASHED_RECOMP_D3D12

View file

@ -472,7 +472,7 @@ void ConfigDef<T, isHidden>::ReadValue(toml::v3::ex::parse_result& toml)
if constexpr (std::is_same<T, std::string>::value)
{
Value = section[Name].value_or<std::string>(DefaultValue);
Value = section[Name].value_or(DefaultValue);
}
else if constexpr (std::is_enum_v<T>)
{

View file

@ -46,6 +46,8 @@ CONFIG_DEFINE_ENUM_LOCALISED("Audio", EChannelConfiguration, ChannelConfiguratio
CONFIG_DEFINE_LOCALISED("Audio", bool, MusicAttenuation, false);
CONFIG_DEFINE_LOCALISED("Audio", bool, BattleTheme, true);
CONFIG_DEFINE("Video", std::string, GraphicsDevice, "");
#ifdef UNLEASHED_RECOMP_D3D12
CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::D3D12);
#else