SDL_ResizeEvent(3)
π SDL_ResizeEvent(3) π
okay bestie, welcome to the SDL API Reference β¨ this one's about the window-resize event structure, and it's genuinely so straightforward you're gonna eat it up π
πΈ NAME πΈ
SDL_ResizeEvent β the window resize event structure πͺβ¨
π§ STRUCTURE DEFINITION π§
here's the whole lil guy, no cap:
typedef struct{
Uint8 type;
int w, h;
} SDL_ResizeEvent;
literally three fields. iconic, honestly. π
π STRUCTURE DATA π
typeβ it'sSDL_VIDEORESIZEπ«w,hβ the new width and height of the window, respectively π
π¦ DESCRIPTION π¦
so SDL_ResizeEvent is a member of the SDL_Event union, and it's the one that shows up when an event of type SDL_VIDEORESIZE gets reported π«Ά
the way it works: when you pass SDL_RESIZABLE as a flag to SDL_SetVideoMode, the user is allowed to resize the application's window π and when they actually do resize it, an SDL_VIDEORESIZE gets reported, with the new window width and height values stored in w and h, respectively π
and here's the part that matters, bestie β when you receive an SDL_VIDEORESIZE, the window should be resized to the new dimensions using SDL_SetVideoMode. don't just sit there with your new w and h doing nothing, that's not the vibe π
fr fr: you get the event, then you call SDL_SetVideoMode with the fresh dimensions. that's the whole loop. periodt. π
π SEE ALSO π
SDL_EventSDL_SetVideoMode
and that's the tea, bestie π΅π this page came from the SDL library, dated Tue 11 Sep 2001, 22:59 β yeah, she's vintage, she's a classic, she's been serving resize events since the Y2K era and she still slays πβ¨ go resize something responsibly πͺπ
π¦ where this page comes from
- debian bookworm: libsdl1.2-dev 1.2.15+dfsg2-8 Β· LGPL-2.1-or-later
- nixos 26.05: SDL_sixel 0-unstable-2016-02-06
- nixpkgs unstable: SDL_sixel 0-unstable-2016-02-06
- ubuntu jammy: libsdl1.2-dev 1.2.15+dfsg2-6 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms