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
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms