|
|
Log In | Not a Member? |
Contact ADC |
| < Previous PageNext Page > |
このアプリケーションは、NSApplicationのサブクラス化を必要とする数少ないアプリケーションの1つです。サブクラスを作成する必要があるのは、sendEvent:メソッドをオーバーライドして、フルスクリーンのOpenGLコンテキストをアプリケーションが表示している間のユーザイベントをキャッチできるようにし、NSApplicationインスタンスを自身のデリゲートとして設定できるようにするためです。詳細については、NSApplicationを参照してください。
主要クラス(NSApplication)を、Info.plistファイルのNSApplication(例ではPlayerApplication)のカスタムサブクラスに置き換える必要があります。XcodeからInfo.plistファイルを開き、次のキー値ペアを検索します。
<key>NSPrincipalClass</key> |
<string>NSApplication</string> |
次に、NSApplicationをサブクラスの名前に置き換えます。この例では、修正後のキー値ペアは次のようになります。
<key>NSPrincipalClass</key> |
<string>PlayerApplication</string> |
Listing 5-1は、PlayerApplicationのインターフェイスを示します。このインターフェイスは、OpenGLコンテキスト、QCRenderer、およびコンポジションのレンダリングをサポートするその他のオブジェクトを作成するための変数が必要です。
Listing 5-1 PlayerApplicationのインターフェイス
@interface PlayerApplication :NSApplication |
{ |
NSOpenGLContext* _openGLContext; |
QCRenderer* _renderer; |
NSString* _filePath; |
NSTimer* _renderTimer; |
NSTimeInterval _startTime; |
NSSize _screenSize; |
} |
@end |
| < Previous PageNext Page > |
Last updated: 2006-12-05
|
Get information on Apple products.
Visit the Apple Store online or at retail locations. 1-800-MY-APPLE Copyright © 2007 Apple Inc. All rights reserved. | Terms of use | Privacy Notice |