Mercurial > sdl-ios-xcode
changeset 619:bf816ce70144
Disable MacOS X screensaver for duration of application run by triggering a
"UsrActivity" alert every five seconds in the Quartz PumpEvents implementation.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Thu, 22 May 2003 06:28:40 +0000 |
parents | 707748c422f8 |
children | 92080b127f82 |
files | src/video/quartz/SDL_QuartzEvents.m |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/video/quartz/SDL_QuartzEvents.m Sat May 03 19:48:37 2003 +0000 +++ b/src/video/quartz/SDL_QuartzEvents.m Thu May 22 06:28:40 2003 +0000 @@ -389,6 +389,15 @@ NSRect titleBarRect; NSAutoreleasePool *pool; + /* Update activity every five seconds to prevent screensaver. --ryan. */ + static Uint32 screensaverTicks = 0; + Uint32 nowTicks = SDL_GetTicks(); + if ((nowTicks - screensaverTicks) > 5000) + { + UpdateSystemActivity(UsrActivity); + screensaverTicks = nowTicks; + } + pool = [ [ NSAutoreleasePool alloc ] init ]; distantPast = [ NSDate distantPast ];