Created
December 13, 2013 22:31
-
-
Save tomekc/7952530 to your computer and use it in GitHub Desktop.
Sparrow Framework 2.0 boilerplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
// create a full-screen window | |
CGRect screenBounds = [UIScreen mainScreen].bounds; | |
_window = [[UIWindow alloc] initWithFrame:screenBounds]; | |
// start up Sparrow | |
_viewController = [[SPViewController alloc] init]; | |
// IMPORTANT to enable depth test | |
// Remove if you do not need to display 3D content | |
GLKView *glkView = (GLKView *)_viewController.view; | |
glkView.drawableDepthFormat = GLKViewDrawableDepthFormat24; | |
[_viewController startWithRoot:[Game class] supportHighResolutions:YES doubleOnPad:YES]; | |
// activate the window | |
[_window setRootViewController:_viewController]; | |
[_window makeKeyAndVisible]; | |
return YES; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <Sparrow-Framework/Sparrow.h> | |
@interface Game : SPSprite | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "Game.h" | |
@implementation Game | |
- (id)init { | |
self = [super init]; | |
if (self) { | |
SPQuad *quad = [[SPQuad alloc] initWithWidth:50 height:50]; | |
quad.color = 0xFF0000; | |
quad.x = 20; | |
quad.y = 20; | |
[self addChild:quad]; | |
} | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment