- 382 名前:名称未設定 mailto:sage [2009/07/25(土) 20:27:13 ID:GHiQoSyC0]
- NSOpenGLViewにテキストイメージを描画したいのですが、
描画した領域が真っ黒になってうまくいきません。 以下ソースですが、 NSImageにテキストを描画してNSBitmapImageRep*を経由して データをglDrawPixels()に渡しています。 ソースはいろいろなHPを参考にしました。 詳しい方、よろしければご指南のほど、お願いいたします。 (その1) NSTextStorage* textStorage; NSTextContainer* textContainer; NSLayoutManager* layoutManager; textStorage = [[NSTextStorage alloc] initWithString:@"Hello"]; NSSize viewSize = [self bounds].size; textContainer = [[NSTextContainer alloc] initWithContainerSize:viewSize]; layoutManager = [[NSLayoutManager alloc] init]; [textStorage addLayoutManager:layoutManager]; [layoutManager addTextContainer:textContainer]; NSRange range = [layoutManager glyphRangeForTextContainer:textContainer]; NSPoint point = NSMakePoint(0.0, 0.0);
|

|