ios :: NitGLKView :: setup
private fun setup(app_delegate: AppDelegate): NativeGLKViewController
import touches_began, touches_moved, touches_ended, touches_cancelled,
update, should_autorotate, supported_interface_orientations,
view_will_transition_to_size in "ObjC" `{
app_delegate.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
app_delegate.window.backgroundColor = [UIColor whiteColor]; // TODO make configurable
// Create EAGL context and view
EAGLContext * context = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES2];
GLKView *view = [[GLKView alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
view.context = context;
// Ask for antialiasing
view.drawableMultisample = GLKViewDrawableMultisample4X;
view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
GameViewController *cont = [[GameViewController alloc] init];
cont.view = view;
// Setup callbacks
NitGLKView_incr_ref(self);
cont.nit_glk_view = self;
// Make our controller the root
view.delegate = cont;
[app_delegate.window setRootViewController: cont];
// Enable the context
[app_delegate.window makeKeyAndVisible];
[EAGLContext setCurrentContext: context];
[view bindDrawable];
return cont;
`}
lib/ios/glkit.nit:109,2--143,3