SDL_SetWindowFocusable(3)

✨ SDL_SetWindowFocusable ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual πŸ’– we're talking about SDL_SetWindowFocusable today and honestly? it's giving "let me decide if this window gets to be the main character" energy πŸ‘‘


🌸 NAME 🌸

SDL_SetWindowFocusable β€” set whether the window may have input focus. fr fr that's the whole vibe πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_video.h>

bool SDL_SetWindowFocusable(SDL_Window *window, bool focusable);

πŸ’… FUNCTION PARAMETERS πŸ’…

  • window β€” the window to set focusable state. like, the one you're about to vibe-check ✨
  • focusable β€” true to allow input focus, false to not allow input focus. no in-between, it's a yes or a no, periodt 🎯

🫢 RETURN VALUE 🫢

Returns true on success or false on failure 😭 and if it fails? call SDL_GetError() for more information, she'll tell you what went wrong πŸ’€


🧚 THREAD SAFETY 🧚

This function should only be called on the main thread. not me trying to sneak it onto a worker thread πŸ™ˆ main thread only, bestie, that's the rule πŸ”₯


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. so if you're on something older... it's giving nothing, she's not there yet πŸ₯²


and that's the whole page, no cap πŸ’œ

sign-off cuteness: this lil masterpiece came from Simple Directmedia Layer, all cozy in SDL 3.4.18, and it's still serving SDL_SetWindowFocusable(3) energy to this very day πŸŒˆπŸ’– go forth and focus responsibly, queen πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from