mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
Added SDL_DROPTEXT event, for dragging and dropping string data.
This patch is based on work in Unreal Engine 4's fork of SDL, compliments of Epic Games.
This commit is contained in:
@@ -77,9 +77,10 @@ main(int argc, char *argv[])
|
||||
while (SDL_PollEvent(&event)) {
|
||||
SDLTest_CommonEvent(state, &event, &done);
|
||||
|
||||
if (event.type == SDL_DROPFILE) {
|
||||
if ((event.type == SDL_DROPFILE) || (event.type == SDL_DROPTEXT)) {
|
||||
const char *typestr = (event.type == SDL_DROPFILE) ? "File" : "Text";
|
||||
char *dropped_filedir = event.drop.file;
|
||||
SDL_Log("File dropped on window: %s", dropped_filedir);
|
||||
SDL_Log("%s dropped on window: %s", typestr, dropped_filedir);
|
||||
SDL_free(dropped_filedir);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user