SDL_DestroyCursor(3)

πŸ’… SDL_DestroyCursor β€” the manual page, but make it cute

okay bestie, welcome to SDL_DestroyCursor(3), a page from the SDL3 FUNCTIONS collection πŸŽ€ yes it's a real manpage, yes it's about mice, no we're not being weird about it.


✨ NAME ✨

SDL_DestroyCursor β€” free a previously-created cursor. that's it. that's the whole job. she's a deleter, not a creator πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_mouse.h>

void SDL_DestroyCursor(SDL_Cursor *cursor);

look at her. one include, one function, zero drama. iconic.


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: use this function to free cursor resources that you made with SDL_CreateCursor(), SDL_CreateColorCursor() or SDL_CreateSystemCursor().

that's the entire plot fr fr. you made a cursor, it's living in memory, and now you're done with it and you gotta let it go. this is the letting-go function. closure, but for pointers 🫢

not me forgetting to destroy my cursors and leaking memory like it's a personality trait 😭 bestie. free your cursors. your RAM will thank you.

🌈 FUNCTION PARAMETERS 🌈

  • cursor β€” the cursor to free. the one you want gone. the cursor in question. hand her over πŸ’–

πŸ‘‘ THREAD SAFETY πŸ‘‘

this function should only be called on the main thread.

no cap. do not be out here calling this from some worker thread thinking you're the main character, because you are not the main thread, and this function said main thread only. main character energy is required here, literally. main thread. only. periodt πŸ’€


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. so if you're on something older than that, sorry babe, she's not there yet πŸ₯Ί


πŸ’œ SEE ALSO πŸ’œ

the cursor creation squad, aka her sources, aka where all these cursors came from in the first place:

iykyk β€” you create with one of these, you destroy with SDL_DestroyCursor. balanced. as all things should be 🧚


and that's the page!! brought to you by Simple Directmedia Layer πŸ’–, running SDL 3.4.18, from the SDL3 era where cursors are cute and memory leaks are not. slay, go free your cursor, and stay on the main thread bestie πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from