1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program Tester Core
3 * ----------------------------------------
5 * Copyright 2014 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief iOS Application Delegate.
22 *//*--------------------------------------------------------------------*/
24 #import "tcuIOSAppDelegate.h"
25 #import "tcuEAGLView.h"
26 #import "tcuIOSViewController.h"
28 @implementation tcuIOSAppDelegate
30 @synthesize window = _window;
31 @synthesize viewController = _viewController;
33 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
35 DE_UNREF(application && launchOptions);
38 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
45 self.window.backgroundColor = [UIColor whiteColor];
47 // Create view controller.
48 self.viewController = [tcuIOSViewController alloc];
50 [self.window setRootViewController:self.viewController];
52 [self.window makeKeyAndVisible];
53 [self.window layoutSubviews];
55 // Disable idle timer (keep screen on).
56 [[UIApplication sharedApplication] setIdleTimerDisabled: YES];
61 - (void)applicationWillResignActive:(UIApplication *)application
63 DE_UNREF(application);
64 [self.viewController stopTestIteration];
67 - (void)applicationDidEnterBackground:(UIApplication *)application
69 DE_UNREF(application);
72 - (void)applicationWillEnterForeground:(UIApplication *)application
74 DE_UNREF(application);
77 - (void)applicationDidBecomeActive:(UIApplication *)application
79 DE_UNREF(application);
80 [self.viewController startTestIteration];
83 - (void)applicationWillTerminate:(UIApplication *)application
85 DE_UNREF(application);
86 [self.viewController stopTestIteration];
92 [_viewController release];