Hey guys,
So I keep working on this, I think I'm close let me know your thoughts.
Sorry for the long post, but I hope its clear where I am at.
In a nutshell what I have is:
1. Created a window file an named it MainWindow.xib
2. Inserted a Tab Bar Controller.
3. Included a Tab option which links to #4 view.
4. Created a UIViewControllerSubclass 'view1' which naturally creates the .h, .m and .xib
Done the following updates:
-In ImageTargetsAppDelegate.h/ImageTargetsAppDelegate.mm
#import <UIKit/UIKit.h>
@interface ImageTargetsAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
UIWindow* window;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
@property (nonatomic, retain) IBOutlet UIViewController *view1;
@end
------
@synthesize window;
@synthesize tabBarController;
@synthesize view1;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
BOOL ret = YES;
self.window.rootViewController = self.tabBarController;
[window makeKeyAndVisible];
return ret;
}
*NOTE: included the releases.
-In View1.h/View.mm
#import <UIKit/UIKit.h>
#import "EAGLView.h"
@interface View1 : UIViewController {
View1 *view1;
EAGLView *viewEAGLView;
}
@property (nonatomic, retain) IBOutlet EAGLView *viewEAGLView;
@property (nonatomic, retain) IBOutlet View1 *view1;
@end
------
*Note: tried also with viewDidAppear, viewWillAppear:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
CGRect viewBounds;
viewBounds.origin.x = 20;
viewBounds.origin.y = 20;
viewBounds.size.width = 200;
viewBounds.size.height = 280;
viewEAGLView = [[EAGLView alloc] initWithFrame: viewBounds];
viewEAGLView.backgroundColor = [UIColor blueColor];
// added color just to test that it's actually showing
self.view.backgroundColor = [UIColor greenColor];
// added color just to test that it's actually showing
[self.view addSubview: viewEAGLView];
[viewEAGLView onCreate];
}
Included alerts in the different methods of EAGLView.mm, just to keep track, for example: onCreate, initQCAR, startCamera...
Visually on the device im seeing the tab bar menu, an the green background with a blue rectangle (what i think its the EAGLView frame) an also the mentioned alerts.
* When i click on the blue box the QCAR menu shows.
* What I'm missing is to get the video shown.
Any advice or suggestions?
Am I on the wrong path, is it possible what I'm trying to achive?
see Images attached.
Thanks MoSR and Omar,
http://ar.qualcomm.at/node/2000738
In your use case, your EAGLview should be one of the views within the UITabBarController, either in the .xib or inserted dynamically. You can load QCAR in the app initialisation as in the sample apps, or manage the lifecycle yourself.
This should give you enough guidance to achieve what you want.