Allow the offscreen and dummy drivers to be used as fallback

This commit is contained in:
Sam Lantinga
2025-12-21 16:17:38 -08:00
parent 37fca1fdcf
commit efc33633e3
2 changed files with 6 additions and 10 deletions

View File

@@ -68,13 +68,11 @@ static void DUMMY_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
// DUMMY driver bootstrap functions // DUMMY driver bootstrap functions
static bool DUMMY_Available(const char *enable_hint) static bool DUMMY_Available(const char *drivername)
{ {
const char *hint = SDL_GetHint(SDL_HINT_VIDEO_DRIVER); const char *hint = SDL_GetHint(SDL_HINT_VIDEO_DRIVER);
if (hint) { if (hint && SDL_strstr(hint, drivername) != NULL) {
if (SDL_strcmp(hint, enable_hint) == 0) { return true;
return true;
}
} }
return false; return false;
} }

View File

@@ -51,13 +51,11 @@ static void OFFSCREEN_DeleteDevice(SDL_VideoDevice *device)
SDL_free(device); SDL_free(device);
} }
static bool OFFSCREEN_Available(const char *enable_hint) static bool OFFSCREEN_Available(const char *drivername)
{ {
const char *hint = SDL_GetHint(SDL_HINT_VIDEO_DRIVER); const char *hint = SDL_GetHint(SDL_HINT_VIDEO_DRIVER);
if (hint) { if (hint && SDL_strstr(hint, drivername) != NULL) {
if (SDL_strcmp(hint, enable_hint) == 0) { return true;
return true;
}
} }
return false; return false;
} }