fixes #50: get rid of GLKViewController

This commit is contained in:
Justin R. Miller
2014-02-07 20:20:15 -05:00
parent 0bccb08028
commit e8bd180f00
2 changed files with 17 additions and 7 deletions

View File

@@ -6,9 +6,8 @@
//
//
#import <GLKit/GLKit.h>
#import <UIKit/UIKit.h>
@interface MBXViewController : GLKViewController
@interface MBXViewController : UIViewController
@end

View File

@@ -10,6 +10,7 @@
#import "MBXSettings.h"
#import <GLKit/GLKit.h>
#import <OpenGLES/EAGL.h>
#import <QuartzCore/QuartzCore.h>
@@ -59,9 +60,9 @@ class MBXMapView
llmr::Map map;
};
- (void)viewDidLoad
- (void)loadView
{
[super viewDidLoad];
[super loadView];
self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
@@ -71,15 +72,23 @@ class MBXMapView
return;
}
mapView = new MBXMapView();
GLKView *view = [[GLKView alloc] initWithFrame:[[UIScreen mainScreen] bounds] context:self.context];
GLKView *view = (GLKView *)self.view;
view.context = self.context;
view.enableSetNeedsDisplay = NO;
view.drawableStencilFormat = GLKViewDrawableStencilFormat8;
[view bindDrawable];
[EAGLContext setCurrentContext:self.context];
self.view = view;
}
- (void)viewDidLoad
{
[super viewDidLoad];
mapView = new MBXMapView();
mapView->init();
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
@@ -160,6 +169,8 @@ class MBXMapView
elapsed = current;
frames = 0;
}
[(GLKView *)self.view display];
}
- (void)handlePanGesture:(UIPanGestureRecognizer *)pan