Commit ef2f13e125a7951d5b4362f17232531601067b20

Sam Lantinga 2021-02-01T22:30:31

Added test command line options to force different window types

diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c
index 3384a82..8b4dfcf 100644
--- a/src/test/SDL_test_common.c
+++ b/src/test/SDL_test_common.c
@@ -30,6 +30,7 @@ static const char *video_usage[] = {
     "[--video driver]", "[--renderer driver]", "[--gldebug]",
     "[--info all|video|modes|render|event]",
     "[--log all|error|system|audio|video|render|input]", "[--display N]",
+    "[--metal-window | --opengl-window | --vulkan-window]",
     "[--fullscreen | --fullscreen-desktop | --windows N]", "[--title title]",
     "[--icon icon.bmp]", "[--center | --position X,Y]", "[--geometry WxH]",
     "[--min-geometry WxH]", "[--max-geometry WxH]", "[--logical WxH]",
@@ -218,6 +219,18 @@ SDLTest_CommonArg(SDLTest_CommonState * state, int index)
         }
         return 2;
     }
+    if (SDL_strcasecmp(argv[index], "--metal-window") == 0) {
+        state->window_flags |= SDL_WINDOW_METAL;
+        return 1;
+    }
+    if (SDL_strcasecmp(argv[index], "--opengl-window") == 0) {
+        state->window_flags |= SDL_WINDOW_OPENGL;
+        return 1;
+    }
+    if (SDL_strcasecmp(argv[index], "--vulkan-window") == 0) {
+        state->window_flags |= SDL_WINDOW_VULKAN;
+        return 1;
+    }
     if (SDL_strcasecmp(argv[index], "--fullscreen") == 0) {
         state->window_flags |= SDL_WINDOW_FULLSCREEN;
         state->num_windows = 1;