我使用以下結構來獲取調整大小的SDL窗口的新寬度和高度。但是通過這種結構,我只能在完成調整大小後才能獲取新數據,即完成拖動並釋放鼠標按鈕時。如何連續獲取新數據,即我拖動窗口的時間。在SDL中獲取Contiunous Window Resize事件2
if (sdl_set->GetMainEvent()->type == SDL_WINDOWEVENT)
{
if (sdl_set->GetMainEvent()->window.event == SDL_WINDOWEVENT_RESIZED)
{
ScreenWidth = sdl_set->GetMainEvent()->window.data1;
ScreenHeight = sdl_set->GetMainEvent()->window.data2;
cout << "Window Resized!" << endl;
}
}
嘗試['SDL_WINDOWEVENT_SIZE_CHANGED'](https://wiki.libsdl.org/SDL_WindowEventID) – Drop
SDL_WINDOWEVENT_SIZE_CHANGED不記錄爲提供連續調整大小更新。並且在實驗上(在Mac OS X上)它沒有。 我也想知道如何在用戶手勢過程中獲得連續調整大小的事件! https://wiki.libsdl.org/SDL_WindowEventID –
這實際上是不可能的,因爲這個bug:https://bugzilla.libsdl.org/show_bug.cgi?id=2077 –