I have built out a program in Unity and brought it into Xcode. The AppController.mm seems to create a UIWindow for the game to be viewed in.
//Code
int OpenEAGL_UnityCallback(UIWindow** window, int* screenWidth, int* screenHeight) { CGRect rect = [[UIScreen mainScreen] bounds];
// Create a full-screen window
_window = [[UIWindow alloc] initWithFrame:rect];
EAGLView* view = [[EAGLView alloc] initWithFrame:rect];
[_window addSubview:view];
CAEAGLLayer* eaglLayer = (CAEAGLLayer*)[view layer];
_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
if (!_context)
return false;
if (![EAGLContext setCurrentContext:_context]) {
_context = 0;
return false;
}
if (!CreateWindowSurface(eaglLayer, GL_RGB565_OES, GL_DEPTH_COMPONENT16_OES, NO, &_surface)) {
return false;
}
glViewport(0, 0, _surface.size.width, _surface.size.height);
[_window makeKeyAndVisible];
[view release];
*window = _window;
*screenWidth = _surface.size.width;
*screenHeight = _surface.size.height;
return true;
}
This code seems to be overriding any other windows I want to create. Basically, I want to be able to do an IB interface at a certain point in the program and be able to switch back to the game at any time. Changing anything in the above code seems to be bad and makes the entire game not work.