SDL_SetCursor(3)
β¨ SDL_SetCursor β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages π this one's SDL_SetCursor(3) and it's literally about making your cursor be the cursor. yes queen, cursor management. we love to see it π«Ά
πΈ NAME πΈ
SDL_SetCursor β set the active cursor. that's it. that's the whole job. main character energy only π
π SYNOPSIS π
#include <SDL3/SDL_mouse.h>
bool SDL_SetCursor(SDL_Cursor *cursor);
like, include the header, call the function, cursor happens β¨
π¦ DESCRIPTION π¦
so the way this works is: this function sets the currently active cursor to the one you hand it. simple as that, no cap.
and if the cursor is currently visible? the change shows up on the display immediately β no waiting, no refresh, it just appears. iconic behaviour fr fr π
also, plot twist that is lowkey useful: SDL_SetCursor(NULL) can be used to force a cursor redraw, if that's something you want for any reason. yes, passing NULL on purpose. it's giving "chaos but make it intentional" π
π FUNCTION PARAMETERS π
cursorβ a cursor to make active. that's your little guy. your pointer protagonist. give it the spotlight π
β RETURN VALUE β
returns true on success or false on failure π and if it fails, bestie, you gotta call SDL_GetError() for more information. she will tell you what went wrong. always ask her. π
π THREAD SAFETY π
π¨ okay so this is important: this function should only be called on the main thread. no side-quest threads. no sneaky background thread energy. main thread or nothing, periodt. π
πΈ AVAILABILITY πΈ
this function is available since SDL 3.2.0. so if you're on anything older, sorry babe, she's not there yet π
π₯ SEE ALSO π₯
SDL_GetCursor(3)β the reverse uno card, iykyk π
and that's the whole page, bestie!! go forth and set those cursors πβ¨
Simple Directmedia Layer Β· SDL 3.4.18 Β· SDL_SetCursor(3) β mwah, catch you in the next man page, ily, bye!! ππ¦π
π¦ 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