Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char** argv)
- {
- // Note: we intentionally drop command line arguments,
- // there's no such thing as a command line on an iOS device :)
- std::cout<<"In the real main!" << std::endl;
- // Important: "SFAppDelegate" must always match the name of the
- // application delegate class defined in sfml-window
- return UIApplicationMain(argc, argv, nil, @"SFAppDelegate");
- }
- ////////////////////////////////////////////////////////////
- -(void)runUserMain
- {
- // Arguments intentionally dropped, see comments in main in sfml-main
- std::cout<<"Running user main" << std::endl;
- sfmlMain(0, NULL);
- }
- ////////////////////////////////////////////////////////////
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
- {
- std::cout<<"Did finish launching" << std::endl;
- // Save the delegate instance
- delegateInstance = self;
- // Instanciate the motion manager
- self.motionManager = [[CMMotionManager alloc] init];
- // Register orientation changes notifications
- [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceOrientationDidChange:) name:UIDeviceOrientationDidChangeNotification object: nil];
- // Change the working directory to the resources directory
- [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]];
- std::cout << "Scheduling call to to call user main" << std::endl;
- // Schedule an indirect call to the user main, so that this call (and the whole
- // init sequence) can end, and the default splashscreen can be destroyed
- [self performSelector:@selector(runUserMain) withObject:nil afterDelay:0.0];
- std::cout << "Post-schedule." << std::endl;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement