I'm trying to set an initial size of GLKView (basically, I want it to be exactly the size of the screen, despite the presence of tabbar). Because I'm using storyboard, GLKView is created automatically within GLKViewController init method (not sure, it is not really documented, but I think so). In GLKViewController I have only viewDidLoad method, here it is:
- (void)viewDidLoad
{
[super viewDidLoad];
self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
if (!self.context) {
NSLog(@"Failed to create ES context");
}
GLKView *view = (GLKView *)self.view;
view.context = self.context;
}
So, if I don't use storyboard, I'd write something like this:
EAGLContext * context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
GLKView *view = [[GLKView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
view.context = context;
view.delegate = self;
GLKViewController * viewController = [[GLKViewController alloc] initWithNibName:nil bundle:nil];
viewController.view = view;
But when using storyboard, I don't have an opportunity to do this:
GLKView *view = [[GLKView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
I have tried to change the frame of the existing view, create a new GLKView and then assign it to viewController.view - with no result.
Is it maybe possible to set up or change the size of the GLKView in different method, etc.?