2
現狀:iOS上
的cocos2d。在模擬器中,我的FPS在標準分辨率設備模式下顯示60,在視網膜設備模式下顯示30(正好一半)。谷歌搜索沒有立竿見影的效果......任何原因爲什麼?cocos2d FPS在視網膜上一半的原因是什麼?
代碼:
- (void) applicationDidFinishLaunching:(UIApplication*)application
{
// Init the window
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Init the View Controller
viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
viewController.wantsFullScreenLayout = YES;
// Try to use CADisplayLink director
// if it fails (SDK < 3.1) use the default director
if(! [CCDirector setDirectorType:kCCDirectorTypeDisplayLink])
[CCDirector setDirectorType:kCCDirectorTypeDefault];
// Create glview
EAGLView *glView = [EAGLView viewWithFrame:[window bounds]
pixelFormat:kEAGLColorFormatRGBA8
depthFormat:0
];
// make the OpenGLView a child of the view controller
[viewController setView:glView];
// make the View Controller a child of the main window
[window addSubview: viewController.view];
[window makeKeyAndVisible];
// Create director
director = [CCDirector sharedDirector];
// attach the openglView to the director
[director setOpenGLView:glView];
#if GAME_AUTOROTATION == kGameAutorotationUIViewController
[director setDeviceOrientation:kCCDeviceOrientationPortrait];
#else
[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
#endif
[director setAnimationInterval:1.0/60];
[director setDisplayFPS:YES];
[director setDeviceOrientation:kCCDeviceOrientationPortrait];
// Set premultiplied alpha
[CCTexture2D PVRImagesHavePremultipliedAlpha:YES];
// Default texture format for PNG/BMP/TIFF/JPEG/GIF images
// It can be RGBA8888, RGBA4444, RGB5_A1, RGB565
// You can change anytime.
[CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA8888];
// Enable High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices
[director enableRetinaDisplay:YES]
[self removeStartupFlicker];
[SceneManager goLoadingScreen];
}
更新:
也許這只是一個模擬器問題?見http://www.cocos2d-iphone.org/forum/topic/20367
爲什麼不直接在設備上測試?
而且我不只是我的視網膜設備上測試,因爲我無知升級我的iPhone4到iOS的最新版本,我不準備掏出$ 30,獅子更新尚未...
@X斜槓似乎是這樣的情況。感謝您的輸入。 – sean
您正在模擬器上測試fps ....? –
不,我告訴他在真實設備上測試FPS,而不是在模擬器上,說我的只有8 FPS僅僅是一個例子 –