mirror of https://github.com/encounter/SDL.git
Merge commit '0025621b8064f5c72561d5d7b7a1fbdde860c236' into main
This commit is contained in:
commit
95405d9625
|
@ -11,16 +11,8 @@
|
|||
*/
|
||||
#include "SDL.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
static void tryOpenURL(const char *url)
|
||||
{
|
||||
int i;
|
||||
if (SDL_Init(SDL_INIT_VIDEO) == -1) {
|
||||
SDL_Log("SDL_Init failed: %s\n", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
const char *url = argv[i];
|
||||
SDL_Log("Opening '%s' ...", url);
|
||||
if (SDL_OpenURL(url) == 0) {
|
||||
SDL_Log(" success!");
|
||||
|
@ -29,6 +21,22 @@ int main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
if (SDL_Init(SDL_INIT_VIDEO) == -1) {
|
||||
SDL_Log("SDL_Init failed: %s\n", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
for (i = 1; i < argc; i++) {
|
||||
tryOpenURL(argv[i]);
|
||||
}
|
||||
} else {
|
||||
tryOpenURL("https://libsdl.org/");
|
||||
}
|
||||
|
||||
SDL_Quit();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue