/*
- Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
exit(rc);
}
int
-SDL_main(int argc, char *argv[])
+main(int argc, char *argv[])
{
int i, done;
SDL_Event event;
consumed = -1;
}
if (consumed < 0) {
- SDLTest_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state));
+ SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state));
quit(1);
}
i += consumed;
while (SDL_PollEvent(&event)) {
SDLTest_CommonEvent(state, &event, &done);
- if (event.type == SDL_DROPFILE) {
+ if (event.type == SDL_DROPBEGIN) {
+ SDL_Log("Drop beginning on window %u", (unsigned int) event.drop.windowID);
+ } else if (event.type == SDL_DROPCOMPLETE) {
+ SDL_Log("Drop complete on window %u", (unsigned int) event.drop.windowID);
+ } else if ((event.type == SDL_DROPFILE) || (event.type == SDL_DROPTEXT)) {
+ const char *typestr = (event.type == SDL_DROPFILE) ? "File" : "Text";
char *dropped_filedir = event.drop.file;
- SDLTest_Log("File dropped on window: %s", dropped_filedir);
+ SDL_Log("%s dropped on window %u: %s", typestr, (unsigned int) event.drop.windowID, dropped_filedir);
SDL_free(dropped_filedir);
}
}