在SDL中,这两个窗口事件之间有什么区别?
SDL_WINDOWEVENT_RESIZED
SDL_WINDOWEVENT_SIZE_CHANGED
在Wiki文档页面中,有this个代码示例:
case SDL_WINDOWEVENT_RESIZED:
SDL_Log("Window %d resized to %dx%d",
event->window.windowID, event->window.data1,
event->window.data2);
break;
case SDL_WINDOWEVENT_SIZE_CHANGED:
SDL_Log("Window %d size changed to %dx%d",
event->window.windowID, event->window.data1,
event->window.data2);
break;
但是我看不出区别。
答案 0 :(得分:4)
来自the SDL Wiki:
SDL_WINDOWEVENT_RESIZED
窗口已调整为data1 x data2;此事件之前总是
SDL_WINDOWEVENT_SIZE_CHANGED
SDL_WINDOWEVENT_SIZE_CHANGED
由于API调用或通过系统或用户更改窗口大小,窗口大小已更改;如果大小是由外部事件(即用户或窗口管理器)更改的,则此事件后跟
SDL_WINDOWEVENT_RESIZED