From 9b1843c8da8fe961a82df12ee20a81a22d23d029 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 21 Dec 2025 16:17:38 -0800
Subject: [PATCH] Allow the offscreen and dummy drivers to be used as fallback
(cherry picked from commit efc33633e3c4363989b467a1a6ab267f413cd016)
---
src/video/dummy/SDL_nullvideo.c | 8 +++-----
src/video/offscreen/SDL_offscreenvideo.c | 8 +++-----
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/video/dummy/SDL_nullvideo.c b/src/video/dummy/SDL_nullvideo.c
index 7be4ae1c6a824..87fd35e9a1c40 100644
--- a/src/video/dummy/SDL_nullvideo.c
+++ b/src/video/dummy/SDL_nullvideo.c
@@ -68,13 +68,11 @@ static void DUMMY_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
// 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);
- if (hint) {
- if (SDL_strcmp(hint, enable_hint) == 0) {
- return true;
- }
+ if (hint && SDL_strstr(hint, drivername) != NULL) {
+ return true;
}
return false;
}
diff --git a/src/video/offscreen/SDL_offscreenvideo.c b/src/video/offscreen/SDL_offscreenvideo.c
index 1ef0f9ea7f386..c490cb2e2ab8c 100644
--- a/src/video/offscreen/SDL_offscreenvideo.c
+++ b/src/video/offscreen/SDL_offscreenvideo.c
@@ -51,13 +51,11 @@ static void OFFSCREEN_DeleteDevice(SDL_VideoDevice *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);
- if (hint) {
- if (SDL_strcmp(hint, enable_hint) == 0) {
- return true;
- }
+ if (hint && SDL_strstr(hint, drivername) != NULL) {
+ return true;
}
return false;
}