Created
October 21, 2009 11:43
-
-
Save paytonrules/215059 to your computer and use it in GitHub Desktop.
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
// Init the window | |
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
// cocos2d will inherit these values | |
[window setUserInteractionEnabled:YES]; | |
[window setMultipleTouchEnabled:YES]; | |
// must be called before any othe call to the director | |
// WARNING: FastDirector doesn't interact well with UIKit controls | |
// [Director useFastDirector]; | |
// before creating any layer, set the landscape mode | |
// Initialize Director | |
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; | |
[[Director sharedDirector] setAnimationInterval:1.0/60]; | |
[[Director sharedDirector] setDisplayFPS:YES]; | |
// Default texture format for PNG/BMP/TIFF/JPEG/GIF images | |
// It can be RGBA8888, RGBA4444, RGB5_A1, RGB565 | |
// You can change anytime. | |
[Texture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888]; | |
// create an openGL view inside a window | |
[[Director sharedDirector] attachInView:window]; | |
// Oh this sucks | |
[window makeKeyAndVisible]; | |
[[Director sharedDirector] runWithScene: [GameScene scene]]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment