mirror of
https://github.com/thes3m/XNI
synced 2024-12-26 13:26:06 +01:00
Merge branch 'master' of https://bitbucket.org/thes3m/xni
This commit is contained in:
commit
41a8a04b69
@ -58,7 +58,8 @@
|
|||||||
Event *activated, *deactivated, *disposed, *exiting;
|
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) GraphicsDevice *graphicsDevice;
|
||||||
|
|
||||||
@property (nonatomic, readonly) BOOL isActive;
|
@property (nonatomic, readonly) BOOL isActive;
|
||||||
|
@ -89,8 +89,6 @@ static NSArray *drawOrderSort;
|
|||||||
|
|
||||||
// Get the game host.
|
// Get the game host.
|
||||||
gameHost = (GameHost*)[UIApplication sharedApplication];
|
gameHost = (GameHost*)[UIApplication sharedApplication];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
@ -98,7 +96,11 @@ static NSArray *drawOrderSort;
|
|||||||
|
|
||||||
// PROPERTIES
|
// PROPERTIES
|
||||||
|
|
||||||
- (GameWindow*) window {
|
- (UIWindow*) window {
|
||||||
|
return [gameHost window].window;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (GameWindow*) gameWindow {
|
||||||
return [gameHost window];
|
return [gameHost window];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,7 +131,7 @@ static NSArray *drawOrderSort;
|
|||||||
|
|
||||||
- (void) run {
|
- (void) run {
|
||||||
// Initialize game window.
|
// Initialize game window.
|
||||||
[self.window initialize];
|
[self.gameWindow initialize];
|
||||||
|
|
||||||
// Create the graphics device so we can finish initialization.
|
// Create the graphics device so we can finish initialization.
|
||||||
graphicsDeviceManager = [services getServiceOfType:[Protocols graphicsDeviceManager]];
|
graphicsDeviceManager = [services getServiceOfType:[Protocols graphicsDeviceManager]];
|
||||||
@ -152,7 +154,7 @@ static NSArray *drawOrderSort;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Force redraw.
|
// Force redraw.
|
||||||
[self.window.gameViewController.gameView layoutSubviews];
|
[self.gameWindow.gameViewController.gameView layoutSubviews];
|
||||||
|
|
||||||
if (usesDisplayLink) {
|
if (usesDisplayLink) {
|
||||||
displayLink = [[CADisplayLink displayLinkWithTarget:self selector:@selector(tick)] retain];
|
displayLink = [[CADisplayLink displayLinkWithTarget:self selector:@selector(tick)] retain];
|
||||||
|
@ -193,7 +193,7 @@
|
|||||||
|
|
||||||
+ (int) getNumberOfVerticesForPrimitiveType:(PrimitiveType)primitiveType primitiveCount:(int)primitiveCount {
|
+ (int) getNumberOfVerticesForPrimitiveType:(PrimitiveType)primitiveType primitiveCount:(int)primitiveCount {
|
||||||
switch (primitiveType) {
|
switch (primitiveType) {
|
||||||
case GL_TRIANGLE_FAN:
|
case PrimitiveTypeTriangleFan:
|
||||||
return primitiveCount;
|
return primitiveCount;
|
||||||
case PrimitiveTypeLineStrip:
|
case PrimitiveTypeLineStrip:
|
||||||
return primitiveCount + 1;
|
return primitiveCount + 1;
|
||||||
@ -217,7 +217,7 @@
|
|||||||
- (void) reset {
|
- (void) reset {
|
||||||
[deviceResetting raiseWithSender:self];
|
[deviceResetting raiseWithSender:self];
|
||||||
|
|
||||||
CAEAGLLayer *layer = (CAEAGLLayer*)game.window.handle;
|
CAEAGLLayer *layer = (CAEAGLLayer*)game.gameWindow.handle;
|
||||||
|
|
||||||
if (multisampling) {
|
if (multisampling) {
|
||||||
// Allocate resolve buffer backing based on the current layer size.
|
// Allocate resolve buffer backing based on the current layer size.
|
||||||
|
@ -121,6 +121,7 @@ typedef enum {
|
|||||||
PrimitiveTypeLineStrip = GL_LINE_STRIP,
|
PrimitiveTypeLineStrip = GL_LINE_STRIP,
|
||||||
PrimitiveTypeTriangleList = GL_TRIANGLES,
|
PrimitiveTypeTriangleList = GL_TRIANGLES,
|
||||||
PrimitiveTypeTriangleStrip = GL_TRIANGLE_STRIP,
|
PrimitiveTypeTriangleStrip = GL_TRIANGLE_STRIP,
|
||||||
|
PrimitiveTypeTriangleFan = GL_TRIANGLE_FAN,
|
||||||
} PrimitiveType;
|
} PrimitiveType;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
[self applyChanges];
|
[self applyChanges];
|
||||||
|
|
||||||
// Listen to client size change from now on.
|
// Listen to client size change from now on.
|
||||||
[game.window.clientSizeChanged
|
[game.gameWindow.clientSizeChanged
|
||||||
subscribeDelegate:[Delegate delegateWithTarget:self Method:@selector(applyChanges)]];
|
subscribeDelegate:[Delegate delegateWithTarget:self Method:@selector(applyChanges)]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,9 +70,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void) applyChanges {
|
- (void) applyChanges {
|
||||||
[game.window setSupportedOrientations:supportedOrientations];
|
[game.gameWindow setSupportedOrientations:supportedOrientations];
|
||||||
[game.window beginScreenDeviceChangeWithFullscreen:isFullScreen];
|
[game.gameWindow beginScreenDeviceChangeWithFullscreen:isFullScreen];
|
||||||
[game.window endScreenDeviceChangeWithClientWidth:self.preferredBackBufferWidth clientHeight:self.preferredBackBufferHeight];
|
[game.gameWindow endScreenDeviceChangeWithClientWidth:self.preferredBackBufferWidth clientHeight:self.preferredBackBufferHeight];
|
||||||
|
|
||||||
if (graphicsDevice != nil && graphicsDevice.graphicsProfile != graphicsProfile) {
|
if (graphicsDevice != nil && graphicsDevice.graphicsProfile != graphicsProfile) {
|
||||||
// Different graphics profile requested.
|
// Different graphics profile requested.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user