1

空の iOS プロジェクトを作成してから、AppDelegate に追加されるカスタム GLView クラスを追加しました。次の質問があります。

1) iPhone 4 で高解像度 Retina モードを有効にするにはどうすればよいですか? 現在、次のコードを使用してデバイスを確認しています。

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

解像度をデフォルトの 480x320 ではなく 960x640 に設定する方法はありますか?

実行時にレンダー バッファーで画像を生成しているため、「someImage@2x.png」は使用できないことに注意してください。

2) 私が抱えている 2 番目の問題は、次の警告メッセージです。

"Application windows are expected to have a root view controller at the end of application launch"

お時間をいただきありがとうございます。

4

1 に答える 1