[SDL] SDL tampers with display power settings on the sly

Erik esigra at gmail.com
Tue Feb 26 23:01:15 PST 2008


Bill Kendrick skrev:
> On Tue, Feb 26, 2008 at 02:25:09PM +0100, Erik wrote:
>   
>> I added SDL_VIDEO_ALLOW_SCREENSAVER=1 to ~/.bashrc and added the 
>> following line to an application, before SDL_Init:
>>
>> setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
>>     
>
> I did a "putenv("SDL_VIDEO_ALLOW_SCREENSAVER=1");" in Tux Paint CVS
> (soon to be released as 0.9.19), but only if "--allowscreensaver" is used.
>   
I chose that setenv command because it will not overwrite the variable 
if the user has set

SDL_VIDEO_ALLOW_SCREENSAVER=0. Therefore the program does not need a command line option like "--allowscreensaver". It is a normal keyboard/mouse game (no joystick) so it should behave like any other program in the user's desktop environment. Therefore it allows the screensaver by default. If a user actually set SDL_VIDEO_ALLOW_SCREENSAVER=0, that setting is respected. (It is a complex strategy game, so a 14 months old would definitely be out of luck with it.)

..




More information about the SDL mailing list