Hi,
In Gideros, OpenGL rendering is done on a different thread (to make touchs more responsive). But this may have problems while adding subviews to the OpenGL view. To overcome this issue, the OpenGL view should be separate from other views. If you have problems while adding UIKit elements, you need to make this modifications to the Xcode project:
1. remove gdr_initialize and gdr_deinitialize functions from GiderosiPhonePlayerViewController.mm
2. add
to the GiderosiPhonePlayerAppDelegate.mm
3. replace application:didFinishLaunchingWithOptions: function with:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIView* glView = self.viewController.view;
UIView* rootView = [[UIView alloc] initWithFrame:[self.window bounds]];
[rootView addSubview:glView];
self.viewController.view = rootView;
[rootView release];
gdr_initialize((EAGLView *)glView, 320, 480, true);
#if 0 // waiting for dropping iOS 3.x compatibility
self.window.rootViewController = self.viewController;
#else
[self.window addSubview:self.viewController.view];
#endif
return YES;
} |
4. replace applicationWillTerminate: function with:
- (void)applicationWillTerminate:(UIApplication *)application
{
gdr_exitGameLoop();
[self.viewController stopAnimation];
gdr_deinitialize();
} |
This modification will be available with the next version.
@MikeHart, did you encounter any problems while adding buttons, webview, etc?
best,
Comments
I am at work and don't have access to my mac. Will let you know later how I did it so far.