diff --git a/Classes/Retronator/Xni/Framework/Game.h b/Classes/Retronator/Xni/Framework/Game.h index 237eb3a..8249158 100644 --- a/Classes/Retronator/Xni/Framework/Game.h +++ b/Classes/Retronator/Xni/Framework/Game.h @@ -58,7 +58,8 @@ Event *activated, *deactivated, *disposed, *exiting; } -@property (nonatomic, readonly) GameWindow *window; +@property (nonatomic, retain) UIWindow *window; +@property (nonatomic, readonly) GameWindow *gameWindow; @property (nonatomic, readonly) GraphicsDevice *graphicsDevice; @property (nonatomic, readonly) BOOL isActive; diff --git a/Classes/Retronator/Xni/Framework/Game.m b/Classes/Retronator/Xni/Framework/Game.m index 0892e20..5a3fa07 100644 --- a/Classes/Retronator/Xni/Framework/Game.m +++ b/Classes/Retronator/Xni/Framework/Game.m @@ -89,8 +89,6 @@ static NSArray *drawOrderSort; // Get the game host. gameHost = (GameHost*)[UIApplication sharedApplication]; - - } return self; @@ -98,7 +96,11 @@ static NSArray *drawOrderSort; // PROPERTIES -- (GameWindow*) window { +- (UIWindow*) window { + return [gameHost window].window; +} + +- (GameWindow*) gameWindow { return [gameHost window]; } @@ -129,7 +131,7 @@ static NSArray *drawOrderSort; - (void) run { // Initialize game window. - [self.window initialize]; + [self.gameWindow initialize]; // Create the graphics device so we can finish initialization. graphicsDeviceManager = [services getServiceOfType:[Protocols graphicsDeviceManager]]; @@ -152,7 +154,7 @@ static NSArray *drawOrderSort; } // Force redraw. - [self.window.gameViewController.gameView layoutSubviews]; + [self.gameWindow.gameViewController.gameView layoutSubviews]; if (usesDisplayLink) { displayLink = [[CADisplayLink displayLinkWithTarget:self selector:@selector(tick)] retain]; diff --git a/Classes/Retronator/Xni/Framework/Graphics/GraphicsDevice.m b/Classes/Retronator/Xni/Framework/Graphics/GraphicsDevice.m index b8dd213..4e1292a 100644 --- a/Classes/Retronator/Xni/Framework/Graphics/GraphicsDevice.m +++ b/Classes/Retronator/Xni/Framework/Graphics/GraphicsDevice.m @@ -193,7 +193,7 @@ + (int) getNumberOfVerticesForPrimitiveType:(PrimitiveType)primitiveType primitiveCount:(int)primitiveCount { switch (primitiveType) { - case GL_TRIANGLE_FAN: + case PrimitiveTypeTriangleFan: return primitiveCount; case PrimitiveTypeLineStrip: return primitiveCount + 1; @@ -217,7 +217,7 @@ - (void) reset { [deviceResetting raiseWithSender:self]; - CAEAGLLayer *layer = (CAEAGLLayer*)game.window.handle; + CAEAGLLayer *layer = (CAEAGLLayer*)game.gameWindow.handle; if (multisampling) { // Allocate resolve buffer backing based on the current layer size. diff --git a/Classes/Retronator/Xni/Framework/Graphics/GraphicsEnums.h b/Classes/Retronator/Xni/Framework/Graphics/GraphicsEnums.h index d6c4e94..9803698 100644 --- a/Classes/Retronator/Xni/Framework/Graphics/GraphicsEnums.h +++ b/Classes/Retronator/Xni/Framework/Graphics/GraphicsEnums.h @@ -121,6 +121,7 @@ typedef enum { PrimitiveTypeLineStrip = GL_LINE_STRIP, PrimitiveTypeTriangleList = GL_TRIANGLES, PrimitiveTypeTriangleStrip = GL_TRIANGLE_STRIP, + PrimitiveTypeTriangleFan = GL_TRIANGLE_FAN, } PrimitiveType; typedef enum { diff --git a/Classes/Retronator/Xni/Framework/GraphicsDeviceManager.m b/Classes/Retronator/Xni/Framework/GraphicsDeviceManager.m index 9134d55..1d117a9 100644 --- a/Classes/Retronator/Xni/Framework/GraphicsDeviceManager.m +++ b/Classes/Retronator/Xni/Framework/GraphicsDeviceManager.m @@ -57,7 +57,7 @@ [self applyChanges]; // Listen to client size change from now on. - [game.window.clientSizeChanged + [game.gameWindow.clientSizeChanged subscribeDelegate:[Delegate delegateWithTarget:self Method:@selector(applyChanges)]]; } @@ -70,9 +70,9 @@ } - (void) applyChanges { - [game.window setSupportedOrientations:supportedOrientations]; - [game.window beginScreenDeviceChangeWithFullscreen:isFullScreen]; - [game.window endScreenDeviceChangeWithClientWidth:self.preferredBackBufferWidth clientHeight:self.preferredBackBufferHeight]; + [game.gameWindow setSupportedOrientations:supportedOrientations]; + [game.gameWindow beginScreenDeviceChangeWithFullscreen:isFullScreen]; + [game.gameWindow endScreenDeviceChangeWithClientWidth:self.preferredBackBufferWidth clientHeight:self.preferredBackBufferHeight]; if (graphicsDevice != nil && graphicsDevice.graphicsProfile != graphicsProfile) { // Different graphics profile requested.