entry: Drop file event for SDL.
This commit is contained in:
Родитель
d616ed345b
Коммит
8c91699678
|
@ -746,6 +746,10 @@ restart:
|
|||
break;
|
||||
|
||||
case Event::DropFile:
|
||||
{
|
||||
const DropFileEvent* drop = static_cast<const DropFileEvent*>(ev);
|
||||
DBG("%s", drop->m_filePath.get() );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -904,6 +908,10 @@ restart:
|
|||
break;
|
||||
|
||||
case Event::DropFile:
|
||||
{
|
||||
const DropFileEvent* drop = static_cast<const DropFileEvent*>(ev);
|
||||
DBG("%s", drop->m_filePath.get() );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче