SDL_GetWindowMouseGrab(3)

πŸ’– SDL_GetWindowMouseGrab πŸ’–

okay bestie so this is a page from the SDL3 FUNCTIONS manual, and today's main character is SDL_GetWindowMouseGrab β€” she's the one who tells you whether a window is currently grabbing the mouse. no cap. ✨


🌸 NAME 🌸

SDL_GetWindowMouseGrab β€” get a window's mouse grab mode. that's it, that's the whole job, and she does it flawlessly πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_video.h>

bool SDL_GetWindowMouseGrab(SDL_Window *window);

like, include the header, call the function, get a bool back. iconic. πŸ¦‹


✨ FUNCTION PARAMETERS ✨

  • window β€” the window you're querying, aka the one you want the tea on πŸ‘€

πŸ’« RETURN VALUE πŸ’«

  • Returns true if the mouse is grabbed 🫢
  • Returns false otherwise πŸ™ˆ

that's the whole vibe check, fr fr.


πŸ”₯ THREAD SAFETY πŸ”₯

bestie. listen. this function should only be called on the main thread. do not try her on a worker thread, she will not be slaying there. πŸ’€

🌈 AVAILABILITY 🌈

this one's been around since SDL 3.2.0 β€” so if you're on anything older, she simply does not exist for you 😭


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, they're all part of the same friend group πŸ’œ


Simple Directmedia Layer wrote this, and it's from SDL 3.4.18 β€” mwah, thanks for coming to my TED talk, ily, go grab a mouse (or don't, that's literally what the function is for) πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from