SDL_test_common: add other window flags: --shown, --hidden, --input-focus, --mouse-focus

This commit is contained in:
Sylvain 2021-04-26 14:22:19 +02:00
parent d62ebec260
commit 9727655b89
No known key found for this signature in database
GPG Key ID: 5F87E02E5BC0939E

View File

@ -36,6 +36,7 @@ static const char *video_usage[] = {
"[--min-geometry WxH]", "[--max-geometry WxH]", "[--logical WxH]",
"[--scale N]", "[--depth N]", "[--refresh R]", "[--vsync]", "[--noframe]",
"[--resizable]", "[--minimize]", "[--maximize]", "[--grab]", "[--keyboard-grab]",
"[--shown]", "[--hidden]", "[--input-focus]", "[--mouse-focus]",
"[--allow-highdpi]", "[--usable-bounds]"
};
@ -424,6 +425,22 @@ SDLTest_CommonArg(SDLTest_CommonState * state, int index)
state->window_flags |= SDL_WINDOW_MAXIMIZED;
return 1;
}
if (SDL_strcasecmp(argv[index], "--shown") == 0) {
state->window_flags |= SDL_WINDOW_SHOWN;
return 1;
}
if (SDL_strcasecmp(argv[index], "--hidden") == 0) {
state->window_flags |= SDL_WINDOW_HIDDEN;
return 1;
}
if (SDL_strcasecmp(argv[index], "--input-focus") == 0) {
state->window_flags |= SDL_WINDOW_INPUT_FOCUS;
return 1;
}
if (SDL_strcasecmp(argv[index], "--mouse-focus") == 0) {
state->window_flags |= SDL_WINDOW_MOUSE_FOCUS;
return 1;
}
if (SDL_strcasecmp(argv[index], "--grab") == 0) {
state->window_flags |= SDL_WINDOW_MOUSE_GRABBED;
return 1;