Mercurial > sdl-ios-xcode
diff src/video/uikit/SDL_uikitappdelegate.m @ 3400:4ec48602f1db
iPhone interruption patch / SDL 1.3
Eric Wing to Sam
I've been sitting on this too long. I need to push.
It's untested because of the unrelated crashing bug I've been experiencing.
Also have a fix for SIZEOF_VOIDP in the config for both iPhone and Mac.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 17 Oct 2009 07:36:45 +0000 |
parents | 99210400e8b9 |
children | ec4db979dddb |
line wrap: on
line diff
--- a/src/video/uikit/SDL_uikitappdelegate.m Tue Oct 13 20:17:11 2009 +0000 +++ b/src/video/uikit/SDL_uikitappdelegate.m Sat Oct 17 07:36:45 2009 +0000 @@ -56,6 +56,7 @@ @implementation SDLUIKitDelegate @synthesize window; +@synthesize windowID; /* convenience method */ +(SDLUIKitDelegate *)sharedAppDelegate { @@ -66,6 +67,7 @@ - (id)init { self = [super init]; window = nil; + windowID = 0; return self; } @@ -97,6 +99,20 @@ } +- (void) applicationWillResignActive:(UIApplication*)application +{ +// NSLog(@"%@", NSStringFromSelector(_cmd)); + SDL_SendWindowEvent(self.windowID, SDL_WINDOWEVENT_MINIMIZED, 0, 0); +} + +- (void) applicationDidBecomeActive:(UIApplication*)application +{ +// NSLog(@"%@", NSStringFromSelector(_cmd)); + SDL_SendWindowEvent(self.windowID, SDL_WINDOWEVENT_RESTORED, 0, 0); +} + + + -(void)dealloc { [window release]; [super dealloc];