sdlDisableScreenSaver function

bool sdlDisableScreenSaver()

Prevent the screen from being blanked by a screen saver.

If you disable the screensaver, it is automatically re-enabled when SDL quits.

The screensaver is disabled by default, but this may by changed by SDL_HINT_VIDEO_ALLOW_SCREENSAVER.

\returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called on the main thread.

\since This function is available since SDL 3.1.3.

\sa SDL_EnableScreenSaver \sa SDL_ScreenSaverEnabled

extern SDL_DECLSPEC bool SDLCALL SDL_DisableScreenSaver(void)

Implementation

bool sdlDisableScreenSaver() {
  final sdlDisableScreenSaverLookupFunction =
      libSdl3.lookupFunction<Uint8 Function(), int Function()>(
          'SDL_DisableScreenSaver');
  return sdlDisableScreenSaverLookupFunction() == 1;
}