SDL_CursorVisible(3)

✨ SDL_CursorVisible(3) ✨

okay bestie, so this is a page from the SDL3 FUNCTIONS collection, and today's main character is SDL_CursorVisible πŸ’…


πŸŽ€ NAME πŸŽ€

SDL_CursorVisible β€” the lil function that tells you whether the cursor is currently being shown. that's it. that's the whole vibe check. πŸ‘€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_mouse.h>

bool SDL_CursorVisible(void);

yes bestie, that's genuinely all of it. no args, no drama, just a question and a yes/no answer. iconic behavior honestly. πŸ¦‹


πŸ’– RETURN VALUE πŸ’–

  • returns true if the cursor is being shown 🫢
  • returns false if the cursor is hidden πŸ™ˆ

like… it literally just reports back. no hidden agendas, no side quests. it's giving "tell me the truth and nothing but the truth". ✨


πŸ”₯ THREAD SAFETY πŸ”₯

bestie. listen. this one is a main thread only situation, no cap.

This function should only be called on the main thread. don't be out here calling it from some random worker thread thinking you're slick, because that is not the move. main character energy belongs on the main thread, periodt. πŸ’€


🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. so if you're on something older… nope, not for you, sorry girl. 😭


πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the whole page!! go check on your cursor bestie, she's waiting πŸŽ€

mwah πŸ’œ this was Simple Directmedia Layer, SDL 3.4.18, and the date on this lil masterpiece is the SDL_CursorVisible(3) line β€” so yeah, that's the era we're in. love that for us. slay, bye!! πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from