1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Change default SDL driver name from opengl to empty (autoselection)

This commit is contained in:
Ivan Savenko 2024-01-14 14:29:13 +02:00
parent f6e0f46040
commit b08462d555
3 changed files with 9 additions and 1 deletions

View File

@ -199,6 +199,7 @@
},
"driver" : {
"type" : "string",
"defaultWindows" : "",
"default" : "opengl",
"description" : "preferred graphics backend driver name for SDL2"
},

View File

@ -169,6 +169,8 @@ static QStringList getAvailableRenderingDrivers()
SDL_Init(SDL_INIT_VIDEO);
QStringList result;
result += QString(); // empty value for autoselection
int driversCount = SDL_GetNumRenderDrivers();
for(int it = 0; it < driversCount; it++)

View File

@ -1289,7 +1289,12 @@ static JsonNode getDefaultValue(const JsonNode & schema, std::string fieldName)
#elif defined(VCMI_ANDROID)
if (!fieldProps["defaultAndroid"].isNull())
return fieldProps["defaultAndroid"];
#elif !defined(VCMI_MOBILE)
#elif defined(VCMI_WINDOWS)
if (!fieldProps["defaultWindows"].isNull())
return fieldProps["defaultWindows"];
#endif
#if !defined(VCMI_MOBILE)
if (!fieldProps["defaultDesktop"].isNull())
return fieldProps["defaultDesktop"];
#endif