Mercurial > sdl-ios-xcode
comparison src/video/quartz/SDL_QuartzEvents.m @ 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 | 7ec821f3cbd0 |
children | fb78cadbfeb8 |
comparison
equal
deleted
inserted
replaced
618:707748c422f8 | 619:bf816ce70144 |
---|---|
387 NSEvent *event; | 387 NSEvent *event; |
388 NSRect winRect; | 388 NSRect winRect; |
389 NSRect titleBarRect; | 389 NSRect titleBarRect; |
390 NSAutoreleasePool *pool; | 390 NSAutoreleasePool *pool; |
391 | 391 |
392 /* Update activity every five seconds to prevent screensaver. --ryan. */ | |
393 static Uint32 screensaverTicks = 0; | |
394 Uint32 nowTicks = SDL_GetTicks(); | |
395 if ((nowTicks - screensaverTicks) > 5000) | |
396 { | |
397 UpdateSystemActivity(UsrActivity); | |
398 screensaverTicks = nowTicks; | |
399 } | |
400 | |
392 pool = [ [ NSAutoreleasePool alloc ] init ]; | 401 pool = [ [ NSAutoreleasePool alloc ] init ]; |
393 distantPast = [ NSDate distantPast ]; | 402 distantPast = [ NSDate distantPast ]; |
394 | 403 |
395 winRect = NSMakeRect (0, 0, SDL_VideoSurface->w, SDL_VideoSurface->h); | 404 winRect = NSMakeRect (0, 0, SDL_VideoSurface->w, SDL_VideoSurface->h); |
396 titleBarRect = NSMakeRect (0, SDL_VideoSurface->h, SDL_VideoSurface->w, | 405 titleBarRect = NSMakeRect (0, SDL_VideoSurface->h, SDL_VideoSurface->w, |