SDL_GetCursor(3)

✨ SDL_GetCursor ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, page SDL_GetCursor(3), and it's giving main character energy for your mouse pointer πŸ’…


🌸 NAME 🌸

SDL_GetCursor β€” Get the active cursor.


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_mouse.h>

SDL_Cursor * SDL_GetCursor(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically this function hands you back a pointer to the current cursor, and the tea is: that cursor is owned by the library. That means it's not necessary to free it with SDL_DestroyCursor(). Do not be out here freeing other people's cursors, bestie, that's not your cursor to free πŸ™ˆ


πŸ’– RETURN VALUE πŸ’–

It returns the active cursor, or NULL if there is no mouse. No mouse = no cursor, periodt.


🧚 THREAD SAFETY 🧚

This function should only be called on the main thread. Like, main character thread only. Don't be side-thread-ing this one, fr fr 😭


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. iconic.


πŸ‘‘ SEE ALSO πŸ‘‘


Simple Directmedia Layer 🫢 SDL 3.4.18 πŸ¦‹ and yeah, this whole vibe is SDL_GetCursor(3) β€” slay, go get that cursor, bestie πŸ’œ

πŸ“¦ where this page comes from