Don't disable the screen saver by default for windows applications

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403490
This commit is contained in:
Sam Lantinga 2009-01-12 08:23:12 +00:00
parent 3c5fca041a
commit 92091bf9b8

View file

@ -377,18 +377,20 @@ ClearVideoSurface()
}
static void
SetupScreenSaver()
SetupScreenSaver(int flags)
{
const char *env;
SDL_bool allow_screensaver;
/* Allow environment override of screensaver disable */
env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
if (env) {
allow_screensaver = SDL_atoi(env) ? SDL_TRUE : SDL_FALSE;
} else {
allow_screensaver = SDL_FALSE;
}
/* Allow environment override of screensaver disable */
env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
if (env) {
allow_screensaver = SDL_atoi(env) ? SDL_TRUE : SDL_FALSE;
} else if (flags & SDL_FULLSCREEN) {
allow_screensaver = SDL_FALSE;
} else {
allow_screensaver = SDL_TRUE;
}
if (allow_screensaver) {
SDL_EnableScreenSaver();
} else {
@ -700,7 +702,7 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
ClearVideoSurface();
SetupScreenSaver();
SetupScreenSaver(flags);
/* We're finally done! */
return SDL_PublicSurface;