diff options
author | 3gg <3gg@shellblade.net> | 2025-08-30 16:53:58 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2025-08-30 16:53:58 -0700 |
commit | 6aaedb813fa11ba0679c3051bc2eb28646b9506c (patch) | |
tree | 34acbfc9840e02cb4753e6306ea7ce978bf8b58e /src/contrib/SDL-3.2.20/test/testurl.c | |
parent | 8f228ade99dd3d4c8da9b78ade1815c9adf85c8f (diff) |
Update to SDL3
Diffstat (limited to 'src/contrib/SDL-3.2.20/test/testurl.c')
-rw-r--r-- | src/contrib/SDL-3.2.20/test/testurl.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/test/testurl.c b/src/contrib/SDL-3.2.20/test/testurl.c new file mode 100644 index 0000000..cc2cb61 --- /dev/null +++ b/src/contrib/SDL-3.2.20/test/testurl.c | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> | ||
3 | |||
4 | This software is provided 'as-is', without any express or implied | ||
5 | warranty. In no event will the authors be held liable for any damages | ||
6 | arising from the use of this software. | ||
7 | |||
8 | Permission is granted to anyone to use this software for any purpose, | ||
9 | including commercial applications, and to alter it and redistribute it | ||
10 | freely. | ||
11 | */ | ||
12 | #include <SDL3/SDL.h> | ||
13 | #include <SDL3/SDL_main.h> | ||
14 | |||
15 | static void tryOpenURL(const char *url) | ||
16 | { | ||
17 | SDL_Log("Opening '%s' ...", url); | ||
18 | if (SDL_OpenURL(url)) { | ||
19 | SDL_Log(" success!"); | ||
20 | } else { | ||
21 | SDL_Log(" failed! %s", SDL_GetError()); | ||
22 | } | ||
23 | } | ||
24 | |||
25 | int main(int argc, char **argv) | ||
26 | { | ||
27 | int i; | ||
28 | if (!SDL_Init(SDL_INIT_VIDEO)) { | ||
29 | SDL_Log("SDL_Init failed: %s", SDL_GetError()); | ||
30 | return 1; | ||
31 | } | ||
32 | |||
33 | if (argc > 1) { | ||
34 | for (i = 1; i < argc; i++) { | ||
35 | tryOpenURL(argv[i]); | ||
36 | } | ||
37 | } else { | ||
38 | tryOpenURL("https://libsdl.org/"); | ||
39 | } | ||
40 | |||
41 | SDL_Quit(); | ||
42 | return 0; | ||
43 | } | ||