SDL_SetWindowResizable(3)

✨ SDL_SetWindowResizable ✨

okay bestie so this is a page from the SDL3 FUNCTIONS manual β€” it's SDL_SetWindowResizable(3) and it's literally about letting people drag your window bigger or smaller πŸ’…


🌸 NAME 🌸

SDL_SetWindowResizable β€” set the user-resizable state of a window. that's it, that's the whole vibe πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_video.h>

bool SDL_SetWindowResizable(SDL_Window *window, bool resizable);

πŸ’– DESCRIPTION πŸ’–

so what this does is it adds or removes the window's SDL_WINDOW_RESIZABLE flag and allows/disallows user resizing of the window. like, you flip the switch, the flag flips with you. iconic. ✨

ngl if the window's resizable state already matches the state you're asking for, this is a no-op. nothing happens. zero drama. it's giving "we already knew" 😌

and okay important one: you can't change the resizable state of a fullscreen window. fullscreen windows said "no thank you" and honestly? valid. 🚫


🫢 FUNCTION PARAMETERS 🫢

  • window β€” the window of which to change the resizable state. yep, that one. the window right there πŸ‘ˆ
  • resizable β€” true to allow resizing, false to disallow. pick your fighter πŸ₯Š

⭐ RETURN VALUE ⭐

returns true on success or false on failure πŸ₯² and if it fails, call SDL_GetError() for more information β€” she will tell you what went wrong, fr fr.


🧡 THREAD SAFETY 🧡

🚨 this function should only be called on the main thread. main character energy only, no side quests, no background threads. periodt. πŸ‘‘

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. so if you're on anything older… bestie. upgrade. 😭


πŸ‘€ SEE ALSO πŸ‘€


mwah πŸ’‹ that's the page! this lil beauty comes to you courtesy of Simple Directmedia Layer, sitting pretty at version SDL 3.4.18 β€” go resize something responsibly, and remember: no-op means no-op πŸ’–πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from