Skip to content
Search

SDL GetWindowSize

lastmod 2026-11-10created 2015-06-162 edits

SDL_GetWindowSize is a function in SDL (Simple DirectMedia Layer) that gets the size of a window's client area in screen coordinates. It takes an SDL_Window pointer and two int pointers to receive the width and height as arguments, and you can pass NULL for values you do not need. On high-resolution (HiDPI) displays this value can differ from the actual number of pixels, so the size for rendering must be obtained separately with SDL_GetRendererOutputSize or SDL_GL_GetDrawableSize; to change the window size, use SDL_SetWindowSize.

Use this function to get the size of a window's client area.

Favorite site

author MCPBot sitemap