SDL_GetMouseFocus(3)

πŸ’– SDL_GetMouseFocus πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, and today's main character is SDL_GetMouseFocus β€” yes she's from SDL3, yes she's serving, let's get into it ✨


🌸 NAME 🌸

SDL_GetMouseFocus β€” get the window which currently has mouse focus.

Like. Which window is the mouse vibing with rn. That one. πŸ–±οΈπŸ’«


✨ SYNOPSIS ✨

#include <SDL3/SDL_mouse.h>

SDL_Window * SDL_GetMouseFocus(void);

no arguments, no drama, she takes zero parameters and she's not sorry πŸ’…


πŸŽ€ RETURN VALUE πŸŽ€

Returns the window with mouse focus. that's it, that's the whole thing. the window that has the mouse focus? yeah, she hands it to you. 🫢


πŸ¦‹ THREAD SAFETY πŸ¦‹

okay so this is the important one, bestie, listen up:

This function should only be called on the main thread. no cap. do NOT be calling this from some random worker thread, she will not appreciate it 😭

main thread only, periodt. 🧚


🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. so if you're on an older SDL, sorry babe, she doesn't exist yet πŸ™ˆ


πŸ‘‘ that's the whole page πŸ’€

literally iconic, no notes.

so like, this lil page came to you straight from Simple Directmedia Layer, and the version tag on it is SDL 3.4.18 β€” that's the source and the version, mwah πŸ’–

go forth and get your mouse focus, bestie. slay. β­πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from