istereo2

diff src/ios/viewctl.m @ 5:6a39b8912752

fuck the UIKit widgets, I'll do my own widgets, with blackjack, and hookers
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 22 Sep 2015 07:13:47 +0300
parents d4fed8aac9a6
children 3bccfc7d10fe
line diff
     1.1 --- a/src/ios/viewctl.m	Mon Sep 21 21:12:36 2015 +0300
     1.2 +++ b/src/ios/viewctl.m	Tue Sep 22 07:13:47 2015 +0300
     1.3 @@ -7,6 +7,7 @@
     1.4  	EAGLContext *ctx;
     1.5  	float pixel_scale;
     1.6  
     1.7 +	GLKView *glview;
     1.8  	ADBannerView *ad;
     1.9  	BOOL ad_visible;
    1.10  }
    1.11 @@ -32,13 +33,13 @@
    1.12          NSLog(@"Failed to create OpenGL ES 2.0 context");
    1.13      }
    1.14  
    1.15 -    GLKView *view = (GLKView*)self.view;
    1.16 -    view.context = self->ctx;
    1.17 -    view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
    1.18 +    glview = (GLKView*)self.view;
    1.19 +    glview.context = self->ctx;
    1.20 +    glview.drawableDepthFormat = GLKViewDrawableDepthFormat24;
    1.21  
    1.22 -	if([view respondsToSelector: NSSelectorFromString(@"contentScaleFactor")]) {
    1.23 +	if([glview respondsToSelector: NSSelectorFromString(@"contentScaleFactor")]) {
    1.24  		pixel_scale = [[UIScreen mainScreen] scale];
    1.25 -		view.contentScaleFactor = pixel_scale;
    1.26 +		glview.contentScaleFactor = pixel_scale;
    1.27  		printf("pixel scale: %g\n", pixel_scale);
    1.28  	} else {
    1.29  		pixel_scale = 1.0f;
    1.30 @@ -98,7 +99,7 @@
    1.31  	[ad setAutoresizingMask: UIViewAutoresizingFlexibleWidth];
    1.32  	ad_visible = YES;
    1.33  	[self hide_ad];
    1.34 -	[self.view addSubview: ad];
    1.35 +	[glview addSubview: ad];
    1.36  	ad.delegate = self;
    1.37  }
    1.38