diff options
author | Sam Green <samuel.green@instacart.com> | 2019-03-14 15:14:20 -0700 |
---|---|---|
committer | Sam Green <samuel.green@instacart.com> | 2019-03-14 16:31:54 -0700 |
commit | 440706814a8a8c43ad4608e6c1cfc6580ce5a5c1 (patch) | |
tree | 59e29c5f74725438f0e4928035e2fa70a3ad0a24 /platform/iphone/app_delegate.mm | |
parent | 775e74e0d41daa9cf3679c2e215f4ef46eee9cbc (diff) |
Add logging around opengl es context creation. Ensure we can access project settings prior to creating our gl es context, so we can properly determine which driver to use.
Diffstat (limited to 'platform/iphone/app_delegate.mm')
-rw-r--r-- | platform/iphone/app_delegate.mm | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index d160553050..64405bfa5b 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -615,18 +615,6 @@ static int frame_count = 0; // Create a full-screen window window = [[UIWindow alloc] initWithFrame:rect]; - // window.autoresizesSubviews = YES; - //[window setAutoresizingMask:UIViewAutoresizingFlexibleWidth | - // UIViewAutoresizingFlexibleWidth]; - - // Create the OpenGL ES view and add it to the window - GLView *glView = [[GLView alloc] initWithFrame:rect]; - printf("glview is %p\n", glView); - //[window addSubview:glView]; - glView.delegate = self; - // glView.autoresizesSubviews = YES; - //[glView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | - // UIViewAutoresizingFlexibleWidth]; OS::VideoMode vm = _get_video_mode(); @@ -641,6 +629,12 @@ static int frame_count = 0; return FALSE; }; + // WARNING: We must *always* create the GLView after we have constructed the + // OS with iphone_main. This allows the GLView to access project settings so + // it can properly initialize the OpenGL context + GLView *glView = [[GLView alloc] initWithFrame:rect]; + glView.delegate = self; + view_controller = [[ViewController alloc] init]; view_controller.view = glView; window.rootViewController = view_controller; |