Selaa lähdekoodia

Allow the offscreen and dummy drivers to be used as fallback

Sam Lantinga 2 kuukautta sitten
vanhempi
commit
efc33633e3
2 muutettua tiedostoa jossa 6 lisäystä ja 10 poistoa
  1. 3 5
      src/video/dummy/SDL_nullvideo.c
  2. 3 5
      src/video/offscreen/SDL_offscreenvideo.c

+ 3 - 5
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;
 }

+ 3 - 5
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;
 }