SDL_GetWindowSizeInPixels(3)
π SDL_GetWindowSizeInPixels(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_GetWindowSizeInPixels β she tells you how big your window's client area is, but in pixels (not those fake units, we'll get there).
β¨ NAME β¨
SDL_GetWindowSizeInPixels β get the size of a window's client area, in pixels. no cap, that's literally the whole job. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_video.h>
bool SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h);
π¦ FUNCTION PARAMETERS π¦
windowβ the window you wanna interrogate. this is the one whose drawable size should be queried, so like, hand her over. π«Άwβ a pointer to a variable for storing the width in pixels. and get this β it may beNULL. so if you don't care about width, you can just... not. iconic. πhβ a pointer to a variable for storing the height in pixels. also may beNULL. same energy, same freedom. β¨
β RETURN VALUE β
returns true on success or false on failure. and if it's giving false, call SDL_GetError() for more information β she'll spill the tea on what went wrong. π
π THREAD SAFETY π
this function should only be called on the main thread. do not try to be cute and call her from a side thread, bestie. she's a main-character function and she stays on the main thread. periodt. π
π AVAILABILITY π
this function is available since SDL 3.2.0. so if you're on something older, sorry babe, she doesn't exist yet. π
π SEE ALSO π
and that's the vibe check β β brought to you by Simple Directmedia Layer, version SDL 3.4.18. go forth and get those pixels, bestie, iykyk πβ¨π¦
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms