如何在 SDL2 中获取 window 的客户区大小
How to get client area size of window in SDL2
如何在 SDL2 中不考虑边界的情况下获得 window 的分辨率?我需要 WinAPI 中的 GetClientRect
功能,但 SDL2 中似乎没有相同的功能。
使用SDL_GetWindowSize,可以抓取客户端window的宽高。
SDL_Window* window = SDL_CreateWindow("Window", 0, 0, 800, 600, 0);
int width;
int height;
SDL_GetWindowSize(window, &width, &height);
width = 800, height = 600
如何在 SDL2 中不考虑边界的情况下获得 window 的分辨率?我需要 WinAPI 中的 GetClientRect
功能,但 SDL2 中似乎没有相同的功能。
使用SDL_GetWindowSize,可以抓取客户端window的宽高。
SDL_Window* window = SDL_CreateWindow("Window", 0, 0, 800, 600, 0);
int width;
int height;
SDL_GetWindowSize(window, &width, &height);
width = 800, height = 600