# HG changeset patch # User Holmes Futrell # Date 1216333777 0 # Node ID 0381047f2210ef3cfb5fb8f7c5ad5eb7ef07317b # Parent dd32c95434f4b3fae9bc622c7d4a0aa2cc103ab8 The class SDL_uikitappdelegate acts as the UIApplicationDelegate for an iPhone SDL project. This class is reponsible for application control flow, including initial setup of working directory, forwarding command line arguments to the user's main function, and handling application termination. diff -r dd32c95434f4 -r 0381047f2210 src/video/uikit/SDL_uikitappdelegate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/video/uikit/SDL_uikitappdelegate.h Thu Jul 17 22:29:37 2008 +0000 @@ -0,0 +1,17 @@ +// +// SDLUIKitDelegate.h +// iPodSDL +// +// Created by Holmes Futrell on 5/29/08. +// Copyright 2008 __MyCompanyName__. All rights reserved. +// + +#import +#import "SDL_uikitopenglview.h" + +@interface SDLUIKitDelegate : NSObject { + UIWindow *window; + SDL_uikitopenglview *view; +} + +@end diff -r dd32c95434f4 -r 0381047f2210 src/video/uikit/SDL_uikitappdelegate.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/video/uikit/SDL_uikitappdelegate.m Thu Jul 17 22:29:37 2008 +0000 @@ -0,0 +1,80 @@ +// +// SDLUIKitDelegate.m +// iPodSDL +// +// Created by Holmes Futrell on 5/29/08. +// Copyright 2008 __MyCompanyName__. All rights reserved. +// + +#import "SDL_uikitappdelegate.h" +#import "SDL_uikitopenglview.h" +#import +#import "SDL_events_c.h" +#import "jump.h" + +#ifdef main +#undef main +#endif + +UIWindow *uikitWindow=nil; +SDL_uikitopenglview *uikitEAGLView=nil; + +extern int SDL_main(int argc, char *argv[]); +static int forward_argc; +static char **forward_argv; + +int main(int argc, char **argv) { + + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + /* store arguments */ + forward_argc = argc; + forward_argv = (char **)malloc(argc * sizeof(char *)); + int i; + for (i=0; i