SDL_EnableScreenSaver(3)

✨ SDL_EnableScreenSaver(3) ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one's called SDL_EnableScreenSaver and it's genuinely so simple you'll be done in like ten seconds πŸ’–


🌸 NAME 🌸

SDL_EnableScreenSaver β€” let the screen get blanked by a screen saver again. yes girl, it's the "go ahead and nap, bestie" button πŸ’€


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_video.h>

bool SDL_EnableScreenSaver(void);

no arguments, no drama, she takes nothing and returns a bool. iconic behavior honestly 🫢


πŸ’… RETURN VALUE πŸ’…

returns true on success and false on failure. and if it fails? don't just sit there wondering, call SDL_GetError() for more information, she'll tell you what went wrong 😭


🧚 THREAD SAFETY 🧚

⚠️ this function should only be called on the main thread. do not try to be cute and call it from a worker thread, the main thread is the main character here, periodt πŸ‘‘

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. so if you're on something older, no she's not there yet, sorry babe πŸ™ˆ


⭐ SEE ALSO ⭐


and that's the whole page, no cap πŸŽ€ it's giving short and sweet. this was Simple Directmedia Layer, SDL 3.4.18, and your girl SDL_EnableScreenSaver(3) signing off πŸ’œβœ¨ bye bestie, go enable that screen saver πŸ¦‹

πŸ“¦ where this page comes from