diff --git a/examples/common/entry/entry.cpp b/examples/common/entry/entry.cpp index ec2d654a6..19c47e705 100644 --- a/examples/common/entry/entry.cpp +++ b/examples/common/entry/entry.cpp @@ -746,6 +746,10 @@ restart: break; case Event::DropFile: + { + const DropFileEvent* drop = static_cast(ev); + DBG("%s", drop->m_filePath.get() ); + } break; default: @@ -904,6 +908,10 @@ restart: break; case Event::DropFile: + { + const DropFileEvent* drop = static_cast(ev); + DBG("%s", drop->m_filePath.get() ); + } break; default: diff --git a/examples/common/entry/entry_sdl.cpp b/examples/common/entry/entry_sdl.cpp index 0425cfe27..7a1482081 100644 --- a/examples/common/entry/entry_sdl.cpp +++ b/examples/common/entry/entry_sdl.cpp @@ -488,6 +488,8 @@ namespace entry WindowHandle defaultWindow = { 0 }; setWindowSize(defaultWindow, m_width, m_height, true); + SDL_EventState(SDL_DROPFILE, SDL_ENABLE); + bx::FileReaderI* reader = NULL; while (NULL == reader) { @@ -806,6 +808,18 @@ namespace entry } break; + case SDL_DROPFILE: + { + const SDL_DropEvent& dev = event.drop; + WindowHandle handle = defaultWindow; //findHandle(dev.windowID); + if (isValid(handle) ) + { + m_eventQueue.postDropFileEvent(handle, dev.file); + SDL_free(dev.file); + } + } + break; + default: { const SDL_UserEvent& uev = event.user;