SDL_ScreenSaverEnabled(3)

πŸ’– SDL_ScreenSaverEnabled(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages β€” this one is a lil cutie from <SDL3/SDL_video.h> and it's literally just you asking the library "hey, is the screensaver on rn?" πŸ¦‹


✨ NAME ✨

SDL_ScreenSaverEnabled β€” check whether the screensaver is currently enabled.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_video.h>

bool SDL_ScreenSaverEnabled(void);

no args, no drama, just vibes πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea: the screensaver is disabled by default. yes, by default SDL is out here keeping your screen awake like it's got main character energy and refuses to nap. 😭

and if that default isn't giving what you need, you can change it with the hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER. that's your little dial to flip the whole vibe. ✨


🌈 RETURN VALUE 🌈

  • true β€” the screensaver is enabled πŸ‘‘
  • false β€” the screensaver is disabled πŸ’€

that's it, that's the whole answer, no hidden lore.


🧚 THREAD SAFETY 🧚

bestie. listen. this function should only be called on the main thread. do not be out here calling it from a side thread, that is not the move, fr fr. πŸ™ˆ

⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. so if you're on something older, it's giving nothing, sorry. 😭


πŸ’œ SEE ALSO πŸ’œ

go read those two, they're the whole friend group 🫢


and that's the page!! brought to you by the fine folks at Simple Directmedia Layer, running SDL 3.4.18 β€” mwah, slay, periodt, go keep your screen awake responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from