4
4
(Object-oriented Graphics Rendering Engine)
5
5
For the latest info, see http://www.ogre3d.org/
7
Copyright (c) 2000-2006 Torus Knot Software Ltd
7
Copyright (c) 2000-2009 Torus Knot Software Ltd
8
8
Also see acknowledgements in Readme.html
10
10
You may use this sample code for anything you like, it is not covered by the
11
LGPL like the rest of the engine.
11
same license as the rest of the engine.
12
12
-----------------------------------------------------------------------------
219
219
int main(int argc, char **argv)
222
#if OGRE_PLATFORM == OGRE_PLATFORM_IPHONE
223
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
224
int retVal = UIApplicationMain(argc, argv, @"UIApplication", @"AppDelegate");
222
228
// Create application object
223
229
ParticleGSApplication app;
239
245
#ifdef __cplusplus
249
#if OGRE_PLATFORM == OGRE_PLATFORM_IPHONE
251
@interface AppDelegate : NSObject <UIApplicationDelegate>
259
@implementation AppDelegate
262
// Create application object
263
ParticleGSApplication app;
266
} catch( Ogre::Exception& e ) {
267
std::cerr << "An exception has occured: " <<
268
e.getFullDescription().c_str() << std::endl;
272
- (void)applicationDidFinishLaunching:(UIApplication *)application {
273
// Hide the status bar
274
[[UIApplication sharedApplication] setStatusBarHidden:YES];
277
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
279
// Create an image view
280
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]];
281
[window addSubview:imageView];
283
// Create an indeterminate status indicator
284
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
285
[indicator setFrame:CGRectMake(150, 280, 20, 20)];
286
[indicator startAnimating];
287
[window addSubview:indicator];
289
// Display our window
290
[window makeKeyAndVisible];
296
[NSThread detachNewThreadSelector:@selector(go) toTarget:self withObject:nil];
299
- (void)applicationWillTerminate:(UIApplication *)application {
300
Root::getSingleton().queueEndRendering();
303
//- (void)applicationWillResignActive:(UIApplication *)application
305
// // Pause FrameListeners and rendering
308
//- (void)applicationDidBecomeActive:(UIApplication *)application
310
// // Resume FrameListeners and rendering