我創建了一個空的iOS項目,然後添加了一個自定義的GLView類,然後將其添加到AppDelegate。我有以下問題:Opengl es高分辨率iphone 4
1)如何在iPhone 4上啓用高分辨率視網膜模式?目前我使用下面的代碼來檢查設備:
CGRect screenBounds = [[UIScreen mainScreen] bounds];
self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease];
// Override point for customization after application launch.
_view = [[GLView alloc] initWithFrame:screenBounds];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
NSLog(@"iPad detected");
}
else {
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] && [[UIScreen mainScreen] scale] == 2) {
NSLog(@"iPhone4 detected");
_view.contentScaleFactor = [[UIScreen mainScreen] scale];
}
else {
NSLog(@"iPhone detected");
}
}
self.window.backgroundColor = [UIColor whiteColor];
//self.window.rootViewController = [[[UIViewController alloc] initWithNibName:nil bundle:nil] autorelease];
[self.window addSubview:_view];
但它是借鑑與鋸齒邊緣的相當差質量的多邊形甚至設置內容因素後如下圖所示的圖像:
http://farm8.staticflickr.com/7358/8725549609_e2ed1e0e2a_b.jpg
有沒有辦法將分辨率設置爲960x640而不是默認的480x320?
請注意,我不能使用「[email protected]」,因爲我在渲染緩衝區中運行時生成圖像。
2)我有第二個問題是這樣的警告消息:
"Application windows are expected to have a root view controller at the end of application launch"
謝謝您的時間。