comparison src/video/SDL_video.c @ 3025:54fac87e1f34

Added an API to enable/disable the screen saver. The screensaver is disabled by default when using SDL 1.2 compatibility. Use the new XScreenSaver extension, removed unused DPMS extension.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 12 Jan 2009 06:19:05 +0000
parents b2025ca5d7a5
children 89f8a72e1ee9
comparison
equal deleted inserted replaced
3024:1a08749aebce 3025:54fac87e1f34
2324 if (SDL_CurrentDisplay.current_renderer == renderer) { 2324 if (SDL_CurrentDisplay.current_renderer == renderer) {
2325 SDL_CurrentDisplay.current_renderer = NULL; 2325 SDL_CurrentDisplay.current_renderer = NULL;
2326 } 2326 }
2327 } 2327 }
2328 2328
2329 SDL_bool
2330 SDL_IsScreenSaverEnabled()
2331 {
2332 if (!_this) {
2333 return SDL_TRUE;
2334 }
2335 return _this->suspend_screensaver ? SDL_FALSE : SDL_TRUE;
2336 }
2337
2338 void
2339 SDL_EnableScreenSaver()
2340 {
2341 if (!_this) {
2342 return;
2343 }
2344 if (!_this->suspend_screensaver) {
2345 return;
2346 }
2347 _this->suspend_screensaver = SDL_FALSE;
2348 if (_this->SuspendScreenSaver) {
2349 _this->SuspendScreenSaver(_this);
2350 }
2351 }
2352
2353 void
2354 SDL_DisableScreenSaver()
2355 {
2356 if (!_this) {
2357 return;
2358 }
2359 if (_this->suspend_screensaver) {
2360 return;
2361 }
2362 _this->suspend_screensaver = SDL_TRUE;
2363 if (_this->SuspendScreenSaver) {
2364 _this->SuspendScreenSaver(_this);
2365 }
2366 }
2367
2329 void 2368 void
2330 SDL_VideoQuit(void) 2369 SDL_VideoQuit(void)
2331 { 2370 {
2332 int i, j; 2371 int i, j;
2333 2372