Browse Source

Adds size/orientation support

master
Joshua Moerman 8 years ago
parent
commit
1ef23adcb9
  1. 5
      GLEssentials/iOS/ViewController.m

5
GLEssentials/iOS/ViewController.m

@ -37,6 +37,7 @@
self.preferredFramesPerSecond = 60; self.preferredFramesPerSecond = 60;
[self setupGL]; [self setupGL];
game.windowSize = self.view.bounds.size;
} }
- (void)dealloc{ - (void)dealloc{
@ -64,6 +65,10 @@
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
} }
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
game.windowSize = self.view.bounds.size;
}
- (void)setupGL{ - (void)setupGL{
[EAGLContext setCurrentContext:self.context]; [EAGLContext setCurrentContext:self.context];
game = [[Game alloc] init]; game = [[Game alloc] init];