SDL_WINDOWEVENT_RESIZED与SDL_WINDOWEVENT_SIZE_CHANGED

问题描述 投票:2回答:1

在SDL中,这两个窗口事件之间有什么不同?

SDL_WINDOWEVENT_RESIZED
SDL_WINDOWEVENT_SIZE_CHANGED

在wiki doc页面中有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;

但我没有看到差异。

c sdl sdl-2
1个回答
4
投票

来自the SDL Wiki

SDL_WINDOWEVENT_RESIZED

窗口已调整为data1 x data2;这个事件总是先于SDL_WINDOWEVENT_SIZE_CHANGED

SDL_WINDOWEVENT_SIZE_CHANGED

窗口大小已更改,无论是API调用还是通过系统或用户更改窗口大小;如果大小被外部事件(即用户或窗口管理器)更改,则此事件后面是SDL_WINDOWEVENT_RESIZED

© www.soinside.com 2019 - 2024. All rights reserved.