SDL_DisableScreenSaver(3)
π SDL_DisableScreenSaver(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we talk about the thing that keeps your screen awake. yes, that thing. no cap, it's more useful than it sounds.
β¨ NAME β¨
SDL_DisableScreenSaver β stop the screen from getting blanked out by a screensaver, fr fr.
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_video.h>
bool SDL_DisableScreenSaver(void);
π¦ DESCRIPTION π¦
So here's the tea: if you disable the screensaver, it gets automatically re-enabled when SDL quits. like, SDL handles the cleanup for you, you don't have to remember. iconic behaviour honestly.
lowkey important detail: the screensaver is disabled by default already. but that vibe can be changed by SDL_HINT_VIDEO_ALLOW_SCREENSAVER. so if you're out here wondering why your screen never sleeps, that hint is your main character.
π RETURN VALUE π
Returns true on success or false on failure. if it's giving failure, call SDL_GetError() for more info. that's your group chat for error deets, always check it.
π§ THREAD SAFETY π§
This function should only be called on the main thread. do not try to be clever and call it from a worker thread, bestie, it's not that girl.
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something older... no. upgrade. periodt.
π SEE ALSO π
and that's the whole page, bestie π
this little corner of the Simple Directmedia Layer docs is living in version SDL 3.4.18 β go keep those screens lit, ily, mwah π«Ά
π¦ 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