SDL_SetWindowBordered(3)

πŸ’… SDL_SetWindowBordered πŸ’…

okay bestie, gather round, because we're talking about SDL_SetWindowBordered β€” that's a function from the SDL3 FUNCTIONS fam, and it's lowkey the glow-up button for your window's edges. ✨


🌸 NAME 🌸

SDL_SetWindowBordered β€” set the border state of a window. yes, that's it. that's the whole job. she does one thing and she does it flawlessly. πŸ’–


✨ SYNOPSIS ✨

#include <SDL3/SDL_video.h>

bool SDL_SetWindowBordered(SDL_Window *window, bool bordered);

like... she's short, she's sweet, she takes two args. main character energy honestly. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie. this function will add or remove the window's SDL_WINDOW_BORDERLESS flag and add or remove the border from the actual window. so it's not just bookkeeping in the flag, she literally changes the real window too. obsessed. πŸ’…

and if the window's border already matches the state you asked for? it's a no-op. she just shrugs and does nothing. no cap. πŸ™ˆ

⚠️ huge warning bestie: you can't change the border state of a fullscreen window. like at all. don't even try it, that's not a vibe. 😭

πŸ“ FUNCTION PARAMETERS πŸ“

  • window β€” the window of which to change the border state. (yes, that window. your window. the one you're thinking about. πŸ‘€)
  • bordered β€” false to remove border, true to add border. binary queen. either you're showing off the edges or you're not. ✨

πŸ’– RETURN VALUE πŸ’–

returns true on success or false on failure β€” and if it fails, bestie, call SDL_GetError() for more information. she's not gonna explain herself, you gotta ask. 😀


🧚 THREAD SAFETY 🧚

this function should only be called on the main thread. main thread only. no side quests. no other threads sneaking in. periodt. πŸ‘‘


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. so if you're on something older... bestie. upgrade. 🫢


🌈 SEE ALSO 🌈


and that's the whole page, bestie!! πŸŽ€ this diva came to you straight from the Simple Directmedia Layer crew, and she's living her best life in SDL 3.4.18. go forth and border (or un-border) responsibly. mwah. πŸ’‹βœ¨

πŸ“¦ where this page comes from