comparison src/SDL_compat.c @ 3028:1c4a059966bd

Don't disable the screen saver by default for windows applications
author Sam Lantinga <slouken@libsdl.org>
date Mon, 12 Jan 2009 08:23:12 +0000
parents 54fac87e1f34
children 77c3e67f0740
comparison
equal deleted inserted replaced
3027:61225d2834a3 3028:1c4a059966bd
375 SDL_FillRect(SDL_PublicSurface, NULL, black); 375 SDL_FillRect(SDL_PublicSurface, NULL, black);
376 SDL_UpdateRect(SDL_PublicSurface, 0, 0, 0, 0); 376 SDL_UpdateRect(SDL_PublicSurface, 0, 0, 0, 0);
377 } 377 }
378 378
379 static void 379 static void
380 SetupScreenSaver() 380 SetupScreenSaver(int flags)
381 { 381 {
382 const char *env; 382 const char *env;
383 SDL_bool allow_screensaver; 383 SDL_bool allow_screensaver;
384 384
385 /* Allow environment override of screensaver disable */ 385 /* Allow environment override of screensaver disable */
386 env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER"); 386 env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
387 if (env) { 387 if (env) {
388 allow_screensaver = SDL_atoi(env) ? SDL_TRUE : SDL_FALSE; 388 allow_screensaver = SDL_atoi(env) ? SDL_TRUE : SDL_FALSE;
389 } else { 389 } else if (flags & SDL_FULLSCREEN) {
390 allow_screensaver = SDL_FALSE; 390 allow_screensaver = SDL_FALSE;
391 } 391 } else {
392 allow_screensaver = SDL_TRUE;
393 }
392 if (allow_screensaver) { 394 if (allow_screensaver) {
393 SDL_EnableScreenSaver(); 395 SDL_EnableScreenSaver();
394 } else { 396 } else {
395 SDL_DisableScreenSaver(); 397 SDL_DisableScreenSaver();
396 } 398 }
698 700
699 SDL_VideoFlags = flags; 701 SDL_VideoFlags = flags;
700 702
701 ClearVideoSurface(); 703 ClearVideoSurface();
702 704
703 SetupScreenSaver(); 705 SetupScreenSaver(flags);
704 706
705 /* We're finally done! */ 707 /* We're finally done! */
706 return SDL_PublicSurface; 708 return SDL_PublicSurface;
707 } 709 }
708 710