SDL_GetDefaultCursor(3)

πŸ’– SDL_GetDefaultCursor(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one's a lil baby function and it's literally so easy, come sit with me 🫢


✨ NAME ✨

SDL_GetDefaultCursor β€” get the default cursor, that's it, that's the whole job πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_mouse.h>

SDL_Cursor * SDL_GetDefaultCursor(void);

✨ DESCRIPTION ✨

so like, this hands you back the default cursor. no arguments, no drama, no nothing. 🌸

and here's the tea: you do not have to call SDL_DestroyCursor() on the return value. not required, bestie. but if you do feel like calling it, that's totally fine too β€” it's safe. so you're covered either way, no wrong answers, we love a low-stakes queen πŸ‘‘


✨ RETURN VALUE ✨

on success you get the default cursor. on failure you get NULL 😭 and then you go call SDL_GetError() for more info, because it always knows what went wrong, iykyk.


✨ THREAD SAFETY ✨

⚠️ main thread only, bestie!! do NOT be calling this from some random thread, it is simply not that girl. main thread. periodt. πŸ’€

✨ AVAILABILITY ✨

this one's been around since SDL 3.2.0 ✨ so if you're on anything older, she's not there yet, sorry angel πŸ™ˆ


and that's the whole page, you ate it, no crumbs πŸŽ€ go forth and have a cute lil default cursor. this has been your girl from Simple Directmedia Layer, running SDL 3.4.18 β€” mwah, love u, bye!! πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from