1
0
mirror of https://github.com/thes3m/XNI synced 2024-12-26 13:26:06 +01:00

Renamed window to gameWindow so that the library won't show warnings and conflicts with Apple APIs.

This commit is contained in:
Samo Pajk 2013-06-25 19:41:12 +02:00
parent 692b18e6a9
commit 4a1a7af619
5 changed files with 16 additions and 12 deletions

View File

@ -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;

View File

@ -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];

View File

@ -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.

View File

@ -121,6 +121,7 @@ typedef enum {
PrimitiveTypeLineStrip = GL_LINE_STRIP,
PrimitiveTypeTriangleList = GL_TRIANGLES,
PrimitiveTypeTriangleStrip = GL_TRIANGLE_STRIP,
PrimitiveTypeTriangleFan = GL_TRIANGLE_FAN,
} PrimitiveType;
typedef enum {

View File

@ -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.